Skip to content

fix(ci): require release tags on main#8

Merged
sor4chi merged 3 commits into
mainfrom
fix/release-only-from-main
Jun 8, 2026
Merged

fix(ci): require release tags on main#8
sor4chi merged 3 commits into
mainfrom
fix/release-only-from-main

Conversation

@sor4chi

@sor4chi sor4chi commented Jun 8, 2026

Copy link
Copy Markdown
Member

どういう変更か

  • Release workflow に「tag の commit が origin/main 上にあること」を検証するステップを追加
  • docs/how-to/release.md に feature branch から tag を push しない旨と、検証失敗時の対処を追記

なぜ変更するのか

  • metrics-exporter-v0.1.0 が main 未 merge の branch から tag push され、GitHub Release が誤って公開されていた
  • Release workflow は tag 形式しか見ておらず、main 上の commit かどうかを判別できなかった

追加の情報

Made with Cursor

sor4chi and others added 2 commits June 9, 2026 00:11
Reject tag pushes whose commit is not on origin/main, and document that
releases must be tagged from main after merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
Only allow tag pushes when the tagged commit matches origin/main HEAD,
not merely an ancestor commit on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sor4chi sor4chi marked this pull request as ready for review June 8, 2026 15:19
@sor4chi sor4chi requested a review from a01sa01to June 8, 2026 15:20
Comment thread .github/workflows/release.yml Outdated
Comment on lines +7 to +8
permissions:
contents: write
contents: read

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jobs で指定してるならここいらない?
もしくは今後ほかの jobs 追加しないならここ write のまま L14, 15 削除するか

Comment thread .github/workflows/release.yml Outdated
Comment on lines +26 to +27
echo "::error::Release tag must point to the current origin/main HEAD (${main_head})."
echo "::error::Got ${GITHUB_SHA}. Merge to main, pull main, then tag the latest commit."

@a01sa01to a01sa01to Jun 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ 2 つの別々のエラーとして表示されそう (そういう想定ならいいけど)

Drop redundant workflow-level permissions and combine tag validation
errors into a single annotation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sor4chi sor4chi requested a review from a01sa01to June 8, 2026 15:27
@sor4chi sor4chi merged commit 98a3a1b into main Jun 8, 2026
4 checks passed
@sor4chi sor4chi deleted the fix/release-only-from-main branch June 8, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants