Skip to content

Commit ba170a2

Browse files
TMHSDigitalclaude
andcommitted
release: refuse to run from any ref other than main
The job pushes HEAD to main and tags it, so a dispatch from another branch would have fast-forwarded main to that branch. A first step now fails the run, before checkout, unless github.ref is refs/heads/main. Closes #170 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXRUqm7oDedPDk3QWtK
1 parent 0835512 commit ba170a2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ jobs:
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 15
2424
steps:
25+
# The job pushes HEAD to main and tags it, so a dispatch from any other
26+
# ref (a thumbs/<month> branch, say) would ship that ref. Stop first.
27+
- name: Refuse a ref other than main
28+
if: github.ref != 'refs/heads/main'
29+
env:
30+
REF: ${{ github.ref }}
31+
run: |
32+
echo "::error::Dataset release runs from main only; this run is on $REF."
33+
exit 1
34+
2535
- name: Checkout
2636
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2737
with:

0 commit comments

Comments
 (0)