openapi #265
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: openapi | |
"on": | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * *" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
openapi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate token | |
id: token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.TOKEN_EXCHANGE_APP }} | |
installation_retrieval_mode: id | |
installation_retrieval_payload: ${{ secrets.TOKEN_EXCHANGE_INSTALL }} | |
private_key: ${{ secrets.TOKEN_EXCHANGE_KEY }} | |
permissions: >- | |
{"contents": "write", "pull_requests": "write"} | |
- name: Checkout source | |
id: source | |
uses: actions/checkout@v4 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Install generator | |
run: npm install @openapitools/openapi-generator-cli -g | |
- name: Run install | |
run: bundle install | |
- name: Run generate | |
run: bash hack/generate-client.sh | |
- name: Create request | |
id: pr | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "feat: automated openapi client update" | |
delete-branch: true | |
branch: openapi-client-update | |
title: "feat: automated openapi client update" | |
body: "New openapi client generated, automerge should handle that!" | |
labels: openapi | |
committer: GitHub Actions <[email protected]> | |
token: ${{ steps.token.outputs.token }} | |
- name: Approve request | |
if: ${{ steps.pr.outputs.pull-request-url }} | |
run: gh pr review --approve "${{ steps.pr.outputs.pull-request-url }}" | |
env: | |
GH_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} | |
- name: Enable automerge | |
if: ${{ steps.pr.outputs.pull-request-url }} | |
run: gh pr merge --rebase --auto "${{ steps.pr.outputs.pull-request-url }}" | |
env: | |
GH_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} | |
... |