File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 4545 - name : Checkout code
4646 uses : actions/checkout@v4
4747 with :
48- ref : ${{ github.event.pull_request.head.sha || github.sha }}
48+ # Keep push/workflow_dispatch on a branch so later auto-commit can push.
49+ # For pull_request_target, analyze the PR head commit contents.
50+ ref : ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref || github.event.pull_request.head.sha }}
4951 submodules : recursive
5052
5153 - name : Build normative tags
@@ -135,8 +137,12 @@ jobs:
135137 git config --local user.email "github-actions[bot]@users.noreply.github.com"
136138 git config --local user.name "github-actions[bot]"
137139 git add ref/*.json
138- git diff --staged --quiet || git commit -m "Auto-update normative tag reference files"
139- git push
140+ if git diff --staged --quiet; then
141+ echo "No reference file changes to commit."
142+ exit 0
143+ fi
144+ git commit -m "Auto-update normative tag reference files"
145+ git push origin "HEAD:${GITHUB_REF#refs/heads/}"
140146
141147 - name : Comment on PR with detected changes
142148 if : >-
You can’t perform that action at this time.
0 commit comments