File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 uses : actions/checkout@v4
2121 with :
2222 fetch-depth : 0 # Fetch all history for proper versioning
23- ref : ${{ github.ref }}
23+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
2424
2525 - name : Setup Node.js
2626 uses : actions/setup-node@v4
4242 - name : Commit build results
4343 run : |
4444 git add build/ -f
45- git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update build files [skip ci]" && git push origin HEAD:${{ github.ref_name }})
45+ if git diff --quiet && git diff --staged --quiet; then
46+ echo "No changes to commit"
47+ exit 0
48+ fi
49+
50+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
51+ git commit -m "chore: update build files [skip ci]"
52+ git push origin HEAD:refs/heads/${{ github.head_ref }}
53+ else
54+ git commit -m "chore: update build files [skip ci]"
55+ git push origin HEAD:refs/heads/${{ github.ref_name }}
56+ fi
You can’t perform that action at this time.
0 commit comments