name: Update "on": repository_dispatch: types: - octokit/openapi release - octokit/types.ts release workflow_dispatch: inputs: version: description: Version of https://www.npmjs.com/package/@octokit/openapi required: true jobs: update_routes: runs-on: ubuntu-latest steps: - uses: actions/create-github-app-token@v2 id: app-token with: app-id: ${{ vars.OCTOKIT_APP_ID }} private-key: ${{ secrets.OCTOKIT_APP_PRIVATE_KEY }} - uses: actions/checkout@v4 with: token: ${{ steps.app-token.outputs.token }} - uses: actions/setup-node@v4 with: cache: npm node-version: lts/* - run: git checkout routes-update || true - run: npm install @octokit/types@latest if: >- github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release' - run: npm ci - run: rm docs/ghe-* - run: rm src/generated/ghe-* - run: npm run update-endpoints if: >- github.event_name == 'repository_dispatch' && github.event.action == 'octokit/openapi release' env: VERSION: ${{ github.event.client_payload.release.tag_name }} - run: npm run update-endpoints if: github.event_name == 'workflow_dispatch' env: VERSION: ${{ github.event.inputs.version }} - run: >- node -e "console.log('::set-output name=version::' + require('@octokit/types/package').octokit['openapi-version'])" if: >- github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release' id: openapi_types - run: npm run update-endpoints if: >- github.event_name == 'repository_dispatch' && github.event.action == 'octokit/types.ts release' env: VERSION: ${{ steps.openapi_types.outputs.version }} - name: Create Pull Request uses: gr2m/create-or-update-pull-request-action@v1.x env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} with: title: 🚧 GitHub OpenAPI specifications changed body: > If there are any new endpoints, then the code changes will likely required an update of [`@octokit/types`](https://github.com/octokit/types.ts/pulls). It should have received a pull request as well, merge & release it first. The `@octokit/types` should be updated automatically shortly after in this pull request. Make sure to update the commits so that the merge results in helpful release notes, see [Merging the Pull Request & releasing a new version](https://github.com/octokit/rest.js/blob/main/CONTRIBUTING.md#merging-the-pull-request--releasing-a-new-version). In general - Avoid breaking changes at all costs - If there are no typescript or code changes, use a `docs` prefix - If there are typescript changes but no code changes, use `fix(typescript)` prefix - If there are code changes, use `fix` if a problem was resolved, `feat` if new endpoints / parameters were added, and `feat(deprecation)` if a method was deprecated. branch: openapi-update commit-message: WIP octokit/openapi updated author: Octokit Bot <33075676+octokitbot@users.noreply.github.com> labels: "Type: Maintenance"