File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2323 steps :
2424 - name : Checkout repository
2525 uses : actions/checkout@v4
26+ with :
27+ ref : ${{ github.head_ref || github.ref_name }}
28+ fetch-depth : 1
2629
2730 - name : Setup Node.js
2831 uses : actions/setup-node@v4
@@ -284,12 +287,13 @@ jobs:
284287 EOF
285288
286289 - name : Commit and push changes
290+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
287291 run : |
288292 git config --local user.email "github-actions[bot]@users.noreply.github.com"
289293 git config --local user.name "github-actions[bot]"
290294 git add TankAlarm-092025-Server-Hologram/WEBSITE_PREVIEW.md TankAlarm-092025-Server-Hologram/screenshots/
291295 git add TankAlarm-112025-Server-BluesOpta/WEBSITE_PREVIEW.md TankAlarm-112025-Server-BluesOpta/screenshots/
292296 git diff --staged --quiet || git commit -m "Update website preview screenshots [skip ci]"
293- git push
297+ git push origin HEAD:${{ github.head_ref || github.ref_name }}
294298 env :
295299 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments