Skip to content

ci: switch release trigger to workflow_dispatch#12

Merged
JerryAgbesi merged 3 commits intomainfrom
feat/add-subcommand
Apr 21, 2026
Merged

ci: switch release trigger to workflow_dispatch#12
JerryAgbesi merged 3 commits intomainfrom
feat/add-subcommand

Conversation

@JerryAgbesi
Copy link
Copy Markdown
Owner

@JerryAgbesi JerryAgbesi commented Apr 21, 2026

Summary

Switches the release workflow from a patch-only auto-tagger to Conventional Commits-aware bumps (mathieudutour/github-tag-action).

Related issue

n/a (follow-up to #11)

Checklist

  • Tests added or updated (if behavior changed)
  • make lint passes
  • go test ./... passes
  • README updated (if user-facing changes)

Summary by CodeRabbit

  • Chores

    • Release workflow now supports a manual trigger that requires a version tag and validates the requested tag exists before releasing. Automated release paths remain, and tag creation uses improved semantic-versioning rules with refined job execution conditions.
  • Documentation

    • Corrected a spelling typo in contributor guidance.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: faded4e2-0b50-4ac8-9e8c-54365d57bff8

📥 Commits

Reviewing files that changed from the base of the PR and between af44733 and c1ec58f.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

Added a manual release path (workflow_dispatch with required tag input); limited automatic tag creation to push events using mathieudutour/github-tag-action@v6.2; release now runs for manual dispatch and verifies the requested tag exists before checkout.

Changes

Cohort / File(s) Summary
Release workflow
/.github/workflows/release.yml
Added required workflow_dispatch input tag. jobs.tag now runs only on push; replaced inline shell tag bump/push with mathieudutour/github-tag-action@v6.2 (tag_prefix: v, default_bump: patch, custom_release_rules). jobs.release condition changed to run on manual dispatch; resolves checkout ref from inputs.tag or tag job output and verifies tag existence for manual runs.
Docs typo fix
AGENTS.md
Fixed typo: "unnesessary" → "unnecessary".

Sequence Diagram(s)

sequenceDiagram
    participant User as User (manual dispatch)
    participant GH as GitHub Actions
    participant TagAction as Tag Action
    participant Repo as Git repository
    participant Release as Release job

    Note over User,GH: Manual dispatch flow
    User->>GH: workflow_dispatch(tag)
    GH->>Repo: git rev-parse refs/tags/<tag> (verify exists)
    GH->>Release: checkout ref = inputs.tag
    Release->>Repo: fetch tag and create release

    Note over GH,TagAction: Push-triggered flow
    Repo->>GH: push event
    GH->>TagAction: run tag action (compute & push tag)
    TagAction->>Repo: create & push tag
    TagAction->>Release: emit tag output
    Release->>Repo: checkout ref = tag output
    Release->>Repo: create release
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped the workflow, found a named tag bright,
A click to call it forward, or a push in flight.
I swapped a noisy script for tidy action cheer,
I sniffed the tag, then celebrated with a carrot near. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: switch release trigger to workflow_dispatch' accurately captures the main change - converting the release workflow from auto-triggered to manual dispatch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-subcommand

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
AGENTS.md (1)

29-29: Capitalize this bullet to match surrounding guideline style.

Nice typo fix. Consider Avoid using unnecessary emojis. for consistency with the other imperative bullets in this section.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 29, The bullet "avoid using unnecessary emojis." should be
capitalized to match the other imperative-style bullets; edit AGENTS.md to
change that line to "Avoid using unnecessary emojis." so it follows the
surrounding guideline style and punctuation.
.github/workflows/release.yml (1)

61-69: Verify dispatched tag before checkout.

Right now checkout can fail before the explicit verification step runs, so the validation is effectively bypassed as a controlled check.

Proposed refactor
-      - name: Checkout
-        uses: actions/checkout@v4
-        with:
-          fetch-depth: 0
-          ref: ${{ steps.ref.outputs.ref }}
-
       - name: Verify dispatched tag exists
         if: github.event_name == 'workflow_dispatch'
-        run: git rev-parse "refs/tags/${{ inputs.tag }}"
+        env:
+          RELEASE_TAG: ${{ inputs.tag }}
+        run: |
+          git ls-remote --exit-code --tags "https://github.com/${{ github.repository }}.git" "refs/tags/${RELEASE_TAG}"
+
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          ref: ${{ steps.ref.outputs.ref }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 61 - 69, The workflow currently
runs the "Checkout" step before the "Verify dispatched tag exists" check so a
missing tag can cause checkout to fail preemptively; reorder the steps so the
step named "Verify dispatched tag exists" (the job step that runs git rev-parse
"refs/tags/${{ inputs.tag }}" with if: github.event_name == 'workflow_dispatch')
executes before the "Checkout" step (uses: actions/checkout@v4) — or
alternatively add an explicit pre-check step that performs git rev-parse under
the same condition and only then perform the checkout — preserving the existing
if condition and step names.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 44-49: The release job's if condition currently allows runs on
push because it permits (needs.tag.result == 'success' &&
needs.tag.outputs.new_tag != '') in addition to github.event_name ==
'workflow_dispatch'; update the condition so the job only runs for manual
dispatch. Replace the combined clause under if with a single check for
github.event_name == 'workflow_dispatch' (remove the needs.tag.result and
needs.tag.outputs.new_tag branch) so that only workflow_dispatch triggers the
release job.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 61-69: The workflow currently runs the "Checkout" step before the
"Verify dispatched tag exists" check so a missing tag can cause checkout to fail
preemptively; reorder the steps so the step named "Verify dispatched tag exists"
(the job step that runs git rev-parse "refs/tags/${{ inputs.tag }}" with if:
github.event_name == 'workflow_dispatch') executes before the "Checkout" step
(uses: actions/checkout@v4) — or alternatively add an explicit pre-check step
that performs git rev-parse under the same condition and only then perform the
checkout — preserving the existing if condition and step names.

In `@AGENTS.md`:
- Line 29: The bullet "avoid using unnecessary emojis." should be capitalized to
match the other imperative-style bullets; edit AGENTS.md to change that line to
"Avoid using unnecessary emojis." so it follows the surrounding guideline style
and punctuation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 689b3116-4f6e-4e53-a0f8-e5c8df44f7c4

📥 Commits

Reviewing files that changed from the base of the PR and between 2f7a728 and 8de10d3.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • AGENTS.md

Comment thread .github/workflows/release.yml Outdated
@JerryAgbesi JerryAgbesi force-pushed the feat/add-subcommand branch from af44733 to c1ec58f Compare April 21, 2026 14:40
@JerryAgbesi JerryAgbesi merged commit a97140e into main Apr 21, 2026
6 checks passed
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