Skip to content

Commit

Permalink
chore: Auto regenerate APIs on OAS package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidnioulz committed Aug 22, 2024
1 parent 1ffae82 commit 872d07a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/automerge-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ permissions:
pull-requests: write

jobs:
# TODO
# dependabot-regen-api:
# runs-on: ubuntu-latest
# if:
# - github.actor == 'dependabot[bot]'
# - TODO -> title contains the OAS package name
# steps:
# - name: Dependabot metadata
# id: metadata
# uses: dependabot/fetch-metadata@v1
# with:
# github-token: "${{ secrets.GITHUB_TOKEN }}"
# - name: Regenerate API clients on OpenAPI Spec change
# run:
# - TODO -> regen all apis
# - TODO -> commit
# env:
# PR_URL: ${{github.event.pull_request.html_url}}
# GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
dependabot-regen-api:
runs-on: ubuntu-latest
if:
- github.actor == 'dependabot[bot]'
- contains(github.event.pull_request.title, "Bump the oas group")
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Regenerate API clients on OpenAPI Spec change
run: |
pnpm i
pnpm api:regen
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "feat(deps): Update OpenAPI Spec generated code"
git push
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
dependabot-approve:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"private": true,
"scripts": {
"api:regen": "turbo run api:regen",
"build": "turbo run build",
"clean": "turbo run clean",
"clean:cache": "turbo run clean --filter=@figmarine/cache",
Expand Down

0 comments on commit 872d07a

Please sign in to comment.