ci: fix trigger paths in config schema generation workflow #1
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 config JSON schema | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'backend/config/*.go' | |
- '!backend/config/config_default.go' | |
- '!backend/config/**test.go' | |
jobs: | |
config: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
- name: Checkout backend | |
uses: actions/checkout@v4 | |
with: | |
path: hanko | |
- name: Generate config JSON schema | |
working-directory: ./hanko/backend | |
run: | | |
go generate ./... | |
go run main.go schema generate config | |
- name: Commit and push to repo | |
working-directory: ./hanko | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "chore: autogenerate config JSON schema" | |
git pull origin main --rebase | |
git push origin HEAD | |
else | |
echo "No changes detected, skipping commit and push." | |
fi |