File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 12
12
contents : write
13
13
runs-on : ubuntu-latest
14
14
steps :
15
+ # For PRs from forks
15
16
- 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' )
16
20
with :
17
21
ref : ${{ github.head_ref }}
18
22
token : ${{ secrets.FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN }}
@@ -35,10 +39,19 @@ jobs:
35
39
- run : uv run bash scripts/generate-client.sh
36
40
env :
37
41
VIRTUAL_ENV : backend/.venv
38
- - name : Commit changes
42
+ - name : Add changes to git
39
43
run : |
40
44
git config --local user.email "[email protected] "
41
45
git config --local user.name "github-actions"
42
46
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 : |
43
51
git diff --staged --quiet || git commit -m "✨ Autogenerate frontend client"
44
52
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