Skip to content

ci: fix tagpr release triggers and container publishing - #190

Merged
rokuosan merged 1 commit into
mainfrom
ci/fix-tagpr-workflow
Nov 27, 2026
Merged

rokuosan merged 1 commit into
mainfrom
ci/fix-tagpr-workflow

Conversation

@rokuosan

Copy link
Copy Markdown
Owner

Problems found

  1. GITHUB_TOKEN-created tags do not trigger separate on.push.tags workflows, so tagpr releases skipped build-container-image.yaml and would leave GHCR container images and latest stale.
  2. tagpr.yml lacked pull_request (labeled / unlabeled) and workflow_dispatch triggers, so adding tagpr:minor on PR Release for v1.3.0 #186 did not refresh the proposed version (v1.2.1 -> v1.3.0).
  3. tagpr.yml lacked concurrency, allowing back-to-back pushes to main to race on tagpr-from-* or tag creation.
  4. GoReleaser steps were duplicated inline in tagpr.yml instead of reusing release-golang.yaml with scoped job permissions, and neither release workflow supported an explicit tag input for manual recovery.

Changes

  • .github/workflows/tagpr.yml:
    • Added pull_request (labeled / unlabeled) filtered to open same-repo tagpr-from-* PRs with tagpr:/tagpr/ labels, plus workflow_dispatch.
    • Added concurrency (group: tagpr, cancel-in-progress: false).
    • Explicitly checked out ref: main so tagpr does not fail on detached HEAD during pull_request events.
    • Replaced inline GoReleaser steps with reusable workflow calls (release-go -> release-golang.yaml, release-container -> build-container-image.yaml) gated on needs.tagpr.outputs.tag != '' && github.event_name != 'pull_request' and least-privilege job permissions.
  • .github/workflows/release-golang.yaml:
    • Added workflow_call (required tag input) and workflow_dispatch optional tag input with tag format validation and checkout ref.
  • .github/workflows/build-container-image.yaml:
    • Added workflow_call (required tag input) and workflow_dispatch optional tag input, resolved release tag/ref/push/attestation context uniformly for tag pushes and explicit inputs.tag, tightened permissions (contents: read, id-token: write, packages: write, attestations: write), and increased timeout-minutes to 20.

Verification

  • mise x actionlint@1.7.12 shellcheck@0.11.0 -- actionlint .github/workflows/tagpr.yml .github/workflows/release-golang.yaml .github/workflows/build-container-image.yaml: passed with no errors or warnings.
  • goreleaser check: passed (1 configuration file(s) validated).

Operational notes

  • Once merged to main, Tag and release will run and pick up the tagpr:minor label already on PR Release for v1.3.0 #186, updating it to v1.3.0.
  • Because GITHUB_TOKEN is used, ci-golang on bot-created tagpr PRs still requires clicking "Approve and run" (switching to a GitHub App token via actions/create-github-app-token is an optional future improvement if automatic PR CI runs are desired).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T07:14:44.390417Z 9120934 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@rokuosan
rokuosan merged commit bba1254 into main Nov 27, 2026
4 checks passed
@rokuosan
rokuosan deleted the ci/fix-tagpr-workflow branch November 27, 2026 09:36
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
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.

1 participant