File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 55 - cron : ' 0 3 * * 1' # Every Monday at 03:00 UTC
66 workflow_dispatch :
77
8+ permissions :
9+ contents : write # Needed for PR creation and branch pushes
10+
811jobs :
912 generate-and-pr :
1013 runs-on : ubuntu-latest
3134 run : |
3235 git config --global user.name "github-actions[bot]"
3336 git config --global user.email "github-actions[bot]@users.noreply.github.com"
34- git add Types/**/*.g.cs
37+ git add Types/**/*.g.cs || true
3538 if git diff --cached --quiet; then
3639 echo "no_changes=true" >> $GITHUB_OUTPUT
3740 else
Original file line number Diff line number Diff line change 1111 generate-and-commit :
1212 runs-on : ubuntu-latest
1313
14+ permissions :
15+ contents : write # Needed to allow push with GITHUB_TOKEN
16+
1417 steps :
1518 - name : Checkout PR branch
1619 uses : actions/checkout@v4
@@ -44,15 +47,24 @@ jobs:
4447 run : |
4548 git config --global user.name "github-actions[bot]"
4649 git config --global user.email "github-actions[bot]@users.noreply.github.com"
47- git add Types/**/*.g.cs
50+ git add Types/**/*.g.cs || true
4851 if git diff --cached --quiet; then
4952 echo "no_changes=true" >> $GITHUB_OUTPUT
5053 else
5154 echo "no_changes=false" >> $GITHUB_OUTPUT
5255 fi
5356
57+ - name : Set up authentication for push
58+ if : steps.last-commit.outputs.author != 'github-actions[bot]' && steps.git-check.outputs.no_changes == 'false'
59+ run : |
60+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
61+ env :
62+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63+
5464 - name : Commit and push changes to PR branch
5565 if : steps.last-commit.outputs.author != 'github-actions[bot]' && steps.git-check.outputs.no_changes == 'false'
5666 run : |
5767 git commit -m "chore(types): update generated types (PR auto-update)"
58- git push
68+ git push
69+ env :
70+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments