diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index c9c84893..1ceab035 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,8 +1,10 @@ name: Update "on": - repository_dispatch: - types: - - octokit/webhooks release + push: + branches: + - renovate/octokit-openapi-webhooks-* + - renovate/octokit-monorepo + - renovate/major-octokit-monorepo jobs: update: runs-on: ubuntu-latest @@ -11,18 +13,8 @@ jobs: - uses: actions/setup-node@v4 with: cache: npm - node-version: 16 + node-version: 20 - run: npm ci - - uses: gr2m/await-npm-package-version-action@v1 - with: - package: "@octokit/webhooks-schemas" - version: ${{ github.event.client_payload.release.tag_name }} - - run: npm install --save-exact --save-dev @octokit/webhooks-schemas@latest - - uses: gr2m/await-npm-package-version-action@v1 - with: - package: "@octokit/webhooks-types" - version: ${{ github.event.client_payload.release.tag_name }} - - run: npm install --save-exact @octokit/webhooks-types@latest - run: npm run generate-types - name: create pull request uses: gr2m/create-or-update-pull-request-action@v1.x @@ -30,19 +22,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.OCTOKITBOT_PAT }} with: title: 🚧 🤖📯 Webhooks changed - body: > - A new release of - [@octokit/webhooks-definitions](https://github.com/octokit/webhooks) - was just released 👋🤖 - - - This pull request updates the TypeScript definitions derived from - `@octokit/webhooks-definitions`. I can't tell if the changes are - fixes, features or breaking, you'll have to figure that out on - yourself and adapt the commit messages accordingly to trigger the - right release, see [our commit message - conventions](https://github.com/octokit/openapi/blob/main/CONTRIBUTING.md#merging-the-pull-request--releasing-a-new-version). - branch: update-octokit-webhooks + body: An update to the OpenAPI spec has been detected, and required updates to your code. Please review the changes and merge this PR if everything looks good. + branch: ${{ github.ref }} author: Octokit Bot commit-message: "WIP: Webhooks changed - please review" - labels: "Type: Maintenance" diff --git a/README.md b/README.md index 44c34bb5..779c6f15 100644 --- a/README.md +++ b/README.md @@ -638,7 +638,7 @@ If there are actions for a webhook, events are emitted for both, the webhook nam | [`repository_import`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_import) | | | [`repository_ruleset`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset) | `created`
`deleted`
`edited` | | [`repository_vulnerability_alert`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_vulnerability_alert) | `create`
`dismiss`
`reopen`
`resolve` | -| [`secret_scanning_alert`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#secret_scanning_alert) | `created`
`reopened`
`resolved`
`revoked` | +| [`secret_scanning_alert`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#secret_scanning_alert) | `created`
`reopened`
`resolved`
`revoked`
`validated` | | [`secret_scanning_alert_location`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#secret_scanning_alert_location) | `created` | | [`security_advisory`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#security_advisory) | `published`
`updated`
`withdrawn` | | [`security_and_analysis`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#security_and_analysis) | | diff --git a/package-lock.json b/package-lock.json index bc3db35c..9187bc10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,14 @@ "version": "0.0.0-development", "license": "MIT", "dependencies": { - "@octokit/openapi-webhooks-types": "5.3.2", + "@octokit/openapi-webhooks-types": "6.0.1", "@octokit/request-error": "^6.0.1", "@octokit/webhooks-methods": "^5.0.0", "aggregate-error": "^5.0.0" }, "devDependencies": { "@jest/types": "^29.0.0", - "@octokit/openapi-webhooks": "5.3.2", + "@octokit/openapi-webhooks": "6.0.1", "@octokit/tsconfig": "^3.0.0", "@types/jest": "^29.0.0", "@types/node": "^20.0.0", @@ -1599,15 +1599,15 @@ "integrity": "sha512-6G+ywGClliGQwRsjvqVYpklIfa7oRPA0vyhPQG/1Feh+B+wU0vGH1JiJ5T25d3g1JZYBHzR2qefLi9x8Gt+cpw==" }, "node_modules/@octokit/openapi-webhooks": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks/-/openapi-webhooks-5.3.2.tgz", - "integrity": "sha512-ab1XEZ1F5f148Yz2OtXeC+ILM+PRWd3NhUf8s56cNU7+f4T1aRynHHyNALD2wN0OA8xkFzRJZUQUcdvNY+AuDg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks/-/openapi-webhooks-6.0.1.tgz", + "integrity": "sha512-IdPhV0ntnijsOTriQZEWJ5QJkUuDA2ejEZfgKsWvrL0LE0pe/o4nbme2p0uBWvJkgT4H4prvgozF7rSlANRKNw==", "dev": true }, "node_modules/@octokit/openapi-webhooks-types": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks-types/-/openapi-webhooks-types-5.3.2.tgz", - "integrity": "sha512-VjJun3PuVcOTZLP2EiRT3o6kIAG58k5DydwcXi+vA82Rd3kvA38h/5VAFasqfmHk+cVY+uNxuBjyLYvTDVeEdw==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks-types/-/openapi-webhooks-types-6.0.1.tgz", + "integrity": "sha512-vDO4ylcm4g0ANTJBZoEODs06vjsw2JlIhvWdC+wTJmHPijzyPJLguIYmgFf9ExQtxnH6Sn1horNHgNV47nT81w==" }, "node_modules/@octokit/request-error": { "version": "6.0.1", diff --git a/package.json b/package.json index 1b2f8dc2..a79aae5d 100644 --- a/package.json +++ b/package.json @@ -41,14 +41,14 @@ ] }, "dependencies": { - "@octokit/openapi-webhooks-types": "5.3.2", + "@octokit/openapi-webhooks-types": "6.0.1", "@octokit/request-error": "^6.0.1", "@octokit/webhooks-methods": "^5.0.0", "aggregate-error": "^5.0.0" }, "devDependencies": { "@jest/types": "^29.0.0", - "@octokit/openapi-webhooks": "5.3.2", + "@octokit/openapi-webhooks": "6.0.1", "@octokit/tsconfig": "^3.0.0", "@types/jest": "^29.0.0", "@types/node": "^20.0.0", diff --git a/scripts/generate-types.ts b/scripts/generate-types.ts index 29484f2c..f873fe2d 100755 --- a/scripts/generate-types.ts +++ b/scripts/generate-types.ts @@ -5,6 +5,7 @@ import * as fs from "node:fs"; import type { OpenAPI3, OperationObject, PathItemObject } from "./types.js"; import { format } from "prettier"; +// @ts-expect-error - There is no type definition for this package, your IDE may complain that this directive is unused but it is not const schema = (await import("@octokit/openapi-webhooks")).default.schemas[ "api.github.com" ] as OpenAPI3; @@ -130,5 +131,5 @@ const run = async () => { await updateReadme(emitterEvents); }; - +console.log("Generating types..."); run(); diff --git a/src/generated/webhook-identifiers.ts b/src/generated/webhook-identifiers.ts index 57b616c8..91b267c2 100644 --- a/src/generated/webhook-identifiers.ts +++ b/src/generated/webhook-identifiers.ts @@ -258,7 +258,8 @@ export type EventPayloadMap = { | WebhookEventDefinition<"secret-scanning-alert-created"> | WebhookEventDefinition<"secret-scanning-alert-reopened"> | WebhookEventDefinition<"secret-scanning-alert-resolved"> - | WebhookEventDefinition<"secret-scanning-alert-revoked">; + | WebhookEventDefinition<"secret-scanning-alert-revoked"> + | WebhookEventDefinition<"secret-scanning-alert-validated">; secret_scanning_alert_location: WebhookEventDefinition<"secret-scanning-alert-location-created">; security_advisory: | WebhookEventDefinition<"security-advisory-published"> diff --git a/src/generated/webhook-names.ts b/src/generated/webhook-names.ts index c4028b10..0b7638ef 100644 --- a/src/generated/webhook-names.ts +++ b/src/generated/webhook-names.ts @@ -266,6 +266,7 @@ export const emitterEventNames = [ "secret_scanning_alert.reopened", "secret_scanning_alert.resolved", "secret_scanning_alert.revoked", + "secret_scanning_alert.validated", "secret_scanning_alert_location", "secret_scanning_alert_location.created", "security_advisory",