Skip to content

octokit/openapi release #88

octokit/openapi release

octokit/openapi release #88

name: OpenAPI Update
on:
repository_dispatch:
types: ["octokit/openapi release"]
push:
branches:
- renovate/openapi-typescript-*
workflow_dispatch:
inputs:
version:
description: "Version of https://www.npmjs.com/package/@octokit/openapi"
required: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- run: npm ci
# set OCTOKIT_OPENAPI_VERSION environment variable for all next steps
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- run: echo "OCTOKIT_OPENAPI_VERSION=${{ github.event.client_payload.release.tag_name }}" >> $GITHUB_ENV
if: github.event.client_payload.release.tag_name
- run: echo "OCTOKIT_OPENAPI_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
if: github.event.inputs.version
# Checking if setting the version actually works
- run: echo "OCTOKIT_OPENAPI_VERSION => $OCTOKIT_OPENAPI_VERSION"
- uses: gr2m/await-npm-package-version-action@v1
with:
package: "@octokit/openapi"
version: ${{ env.OCTOKIT_OPENAPI_VERSION }}
# do not update cache for renovate update
- name: Update cache
if: github.event_name != 'push'
run: |
# openapi types
node scripts/types-openapi/download.js
# rest api types for github.com
node scripts/types-rest-api/download.js
# rest api types for the ... rest
node scripts/types-rest-api-diff/download.js
- name: Generate types
run: |
# openapi types
node scripts/types-openapi/update.js
# rest api types for github.com
node scripts/types-rest-api/update.js
# rest api types for the ... rest
node scripts/types-rest-api-diff/update.js
env:
GITHUB_TOKEN: ${{ secrets.OCTOKITBOT_PAT }}
# create/update pull request for dispatch event update
- name: Create Pull Request
if: github.event_name != 'push'
uses: gr2m/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.OCTOKITBOT_PAT }}
with:
title: "🚧 OpenAPI types changed"
body: |
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/master/CONTRIBUTING.md#merging-the-pull-request--releasing-a-new-version).
In general
- Avoid breaking changes at all costs
- If there are no typescript changes, use `build: cache` as commit message
- If there are there are only updates, use `fix: ...`
- If there are any new additions, use `feat: ...`
- If there are breaking changes, keep the previous ones and deprecate them. Only if there is no other way, add `BREAKING CHANGE: ...` to the commit body (not subject!) to trigger a breaking change.
branch: "openapi-update"
commit-message: "WIP"
author: "Octokit Bot <[email protected]>"
labels: "Type: Maintenance,typescript"
# update pull request for renovate update
- name: Create Pull Request
if: github.event_name == 'push'
uses: gr2m/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.OCTOKITBOT_PAT }}
with:
title: "🚧 OpenAPI types changed"
body: |
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/master/CONTRIBUTING.md#merging-the-pull-request--releasing-a-new-version).
In general
- Avoid breaking changes at all costs
- If there are no typescript changes, use `build: cache` as commit message
- If there are there are only updates, use `fix: ...`
- If there are any new additions, use `feat: ...`
- If there are breaking changes, keep the previous ones and deprecate them. Only if there is no other way, add `BREAKING CHANGE: ...` to the commit body (not subject!) to trigger a breaking change.
branch: "${{ github.ref }}"
commit-message: "WIP"
author: "Octokit Bot <[email protected]>"
labels: "Type: Maintenance,typescript"