Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency @octokit/openapi-webhooks-types to v6 - abandoned #978

Merged
merged 10 commits into from
Feb 24, 2024
36 changes: 8 additions & 28 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -11,38 +13,16 @@ 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/[email protected]
env:
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 <[email protected]>
commit-message: "WIP: Webhooks changed - please review"
labels: "Type: Maintenance"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br>`deleted`<br>`edited` |
| [`repository_vulnerability_alert`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_vulnerability_alert) | `create`<br>`dismiss`<br>`reopen`<br>`resolve` |
| [`secret_scanning_alert`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#secret_scanning_alert) | `created`<br>`reopened`<br>`resolved`<br>`revoked` |
| [`secret_scanning_alert`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#secret_scanning_alert) | `created`<br>`reopened`<br>`resolved`<br>`revoked`<br>`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`<br>`updated`<br>`withdrawn` |
| [`security_and_analysis`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#security_and_analysis) | |
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -130,5 +131,5 @@ const run = async () => {

await updateReadme(emitterEvents);
};

console.log("Generating types...");
run();
3 changes: 2 additions & 1 deletion src/generated/webhook-identifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
1 change: 1 addition & 0 deletions src/generated/webhook-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading