File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1212 contents : write
1313 runs-on : ubuntu-latest
1414 steps :
15+ # For PRs from forks
1516 - uses : actions/checkout@v4
17+ # For PRs from the same repo
18+ - uses : actions/checkout@v4
19+ if : ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
1620 with :
1721 ref : ${{ github.head_ref }}
1822 token : ${{ secrets.FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN }}
@@ -35,10 +39,19 @@ jobs:
3539 - run : uv run bash scripts/generate-client.sh
3640 env :
3741 VIRTUAL_ENV : backend/.venv
38- - name : Commit changes
42+ - name : Add changes to git
3943 run : |
4044 git config --local user.email "github-actions@github.com"
4145 git config --local user.name "github-actions"
4246 git add frontend/src/client
47+ # Same repo PRs
48+ - name : Push changes
49+ if : ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
50+ run : |
4351 git diff --staged --quiet || git commit -m "✨ Autogenerate frontend client"
4452 git push
53+ # Fork PRs
54+ - name : Check changes
55+ if : ( github.event_name == 'pull_request' && github.secret_source != 'Actions' )
56+ run : |
57+ git diff --staged --quiet || echo "Changes detected in generated client, run scripts/generate-client.sh and commit the changes"
You can’t perform that action at this time.
0 commit comments