Skip to content

Commit

Permalink
fix: checking if api changed before commiting
Browse files Browse the repository at this point in the history
  • Loading branch information
Regikon committed Dec 18, 2024
1 parent b9ccdb6 commit 89fec15
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,21 @@ jobs:
- name: Generate API specification
run: |
swag init --generalInfo ./cmd/app/main.go --output api/ --pd
- name: Check if API updated
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
api
- name: Commit API
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./api
git commit -m "chore: update api"
- name: Push API
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
Expand Down

0 comments on commit 89fec15

Please sign in to comment.