Feat extend user import (#1992) #2
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 import JSON schema | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- backend/cmd/user/format.go | |
jobs: | |
import: | |
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 import JSON schema | |
working-directory: ./hanko/backend | |
run: | | |
go generate ./... | |
go run main.go schema generate import | |
- name: Create pull request | |
working-directory: ./hanko | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
if ! git diff-index --quiet HEAD; then | |
git checkout -b "chore-autogenerate-import-json-schema-${{ github.run_id }}" | |
git commit -m "chore: autogenerate import JSON schema" | |
git push origin HEAD | |
gh pr create \ | |
-B main \ | |
-H "chore-autogenerate-import-json-schema-${{ github.run_id }}" \ | |
-t "chore: autogenerate import JSON schema" \ | |
-b '# Description | |
Autogenerate import JSON schema. Created by Github Action. | |
# Additional context | |
Ref: `${{ github.ref }}` | |
Workflow name: `${{ github.workflow }}` | |
Job ID: `${{ github.job }}` | |
Run ID: `${{ github.run_id }}`' | |
else | |
echo "No changes detected, skipping pull request creation." | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |