docs(openapi): Proposal for better OpenAPI definitions #6
Workflow file for this run
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: Generate and push OpenAPI | |
on: | |
pull_request: | |
jobs: | |
push-buf: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: bufbuild/buf-setup-action@v1 | |
- uses: bufbuild/buf-push-action@v1 | |
with: | |
buf_token: ${{ secrets.botBufToken }} | |
gen-buf-openapi: | |
runs-on: ubuntu-latest | |
needs: push-buf | |
steps: | |
- uses: bufbuild/buf-setup-action@v1 | |
- name: Checkout protobuf repository | |
uses: actions/checkout@v3 | |
- name: Import GPG Key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.botGPGPrivateKey }} | |
passphrase: ${{ secrets.botGPGPassphrase }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_tag_gpgsign: true | |
- name: Generate OpenAPI and commit | |
run: | | |
buf generate | |
if [[ `git status --porcelain` ]]; then | |
git add openapiv2 | |
git commit -S -m "chore: auto-gen by protobufs" -m "triggered by commit: https://github.com/instill-ai/protobufs/commit/${GITHUB_SHA}" | |
git push origin "HEAD:${GITHUB_HEAD_REF}" | |
fi |