Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Jan 21, 2026

Summary

Fixes the CI failure where the release pipeline couldn't trigger the polish workflow.

Root Cause

The GitHub App token doesn't have actions:write permission, which is required for workflow_dispatch. The error was:

HTTP 403: Resource not accessible by integration

Solution

Switch to repository_dispatch which:

Changes

  • release-prepare.yml: Use gh api to trigger repository_dispatch instead of gh workflow run
  • polish-release-notes.yml: Add repository_dispatch trigger type alongside existing workflow_dispatch
  • Delete test workflow (validation complete)

Test Plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated internal release automation workflows to improve dispatch triggering mechanisms and workflow coordination.

✏️ Tip: You can customize this high-level summary in your review settings.

The GitHub App token doesn't have actions:write permission, which is
required for workflow_dispatch. Switch to repository_dispatch which
works with existing contents:write permission.

Changes:
- release-prepare.yml: Use gh api to trigger repository_dispatch
- polish-release-notes.yml: Add repository_dispatch trigger type
- Delete test workflow (validation complete)

Tested via PR #542 - both workflow_dispatch and repository_dispatch
triggers work correctly with claude-code-action.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The changes modify GitHub Actions workflows to use repository_dispatch events instead of workflow_dispatch for triggering the polish-release-notes workflow from release-prepare. This includes updating TAG_NAME resolution logic to handle both trigger types and removing an associated test workflow.

Changes

Cohort / File(s) Change Summary
Polish release notes workflow
.github/workflows/polish-release-notes.yml
Added repository_dispatch trigger type with [polish-release-notes] event. Updated TAG_NAME resolution to support both repository_dispatch (via client_payload.tag_name) and workflow_dispatch (via inputs.tag_name) with fallback logic.
Release prepare workflow
.github/workflows/release-prepare.yml
Replaced gh workflow run invocation with REST API repository_dispatch call using gh api repos/${{ github.repository }}/dispatches. Passes tag_name via client_payload instead of workflow inputs.
Test dispatch workflow
.github/workflows/test-polish-dispatch.yml
Deleted entire workflow file (133 lines removed). File contained repository_dispatch and workflow_dispatch triggers, TAG_NAME resolution logic, and job for testing release note polishing with Claude AI integration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A dispatch through the night, so clean and so right,
Repository signals in payload delight,
TAG_NAME flows both ways, trigger or not,
The test workflow bids adieu to the slot!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ci): use repository_dispatch for polish release notes' directly and clearly describes the main change in the pull request—switching from workflow_dispatch to repository_dispatch for triggering the polish release notes workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

@greptile-apps
Copy link

greptile-apps bot commented Jan 21, 2026

Greptile Summary

Fixes CI failure by switching from workflow_dispatch to repository_dispatch for triggering the polish release notes workflow. The GitHub App token lacks actions:write permission but has contents:write, which works with repository_dispatch.

  • Replaced gh workflow run with gh api POST to /dispatches endpoint in release-prepare.yml
  • Added repository_dispatch trigger to polish-release-notes.yml alongside existing workflow_dispatch
  • Updated TAG_NAME environment variable to handle both trigger types using fallback (client_payload.tag_name || inputs.tag_name)
  • Deleted test workflow after successful validation in PR test: validate repository_dispatch for polish workflow #542

The solution is straightforward and follows the validation done in the test workflow.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The approach was pre-validated in PR test: validate repository_dispatch for polish workflow #542, the changes are minimal and well-documented. Score of 4 instead of 5 due to the JSON escaping consideration in the gh api command, though this is unlikely to cause issues with standard semver tags.
  • Pay close attention to .github/workflows/release-prepare.yml for the JSON escaping consideration

Important Files Changed

Filename Overview
.github/workflows/release-prepare.yml Replaced gh workflow run with gh api repository_dispatch to work with contents:write permission. Minor JSON escaping consideration for tag values.
.github/workflows/polish-release-notes.yml Added repository_dispatch trigger and updated TAG_NAME env to support both trigger types using logical OR fallback.

Sequence Diagram

sequenceDiagram
    participant M as Main Branch Push
    participant R as Release Prepare Workflow
    participant C as Changesets Action
    participant N as npm Registry
    participant A as GitHub API
    participant P as Polish Release Notes Workflow
    participant G as GitHub Releases

    M->>R: Trigger on push to main
    R->>C: Run changesets action
    alt Version PR not merged yet
        C->>R: Create/update Version PR
        R-->>M: Wait for Version PR merge
    else Version PR merged
        C->>N: Publish package to npm
        C->>G: Create GitHub release with changelog
        C->>R: Set published=true output
        R->>A: POST /repos/{owner}/{repo}/dispatches
        Note over R,A: event_type: polish-release-notes<br/>client_payload: {tag_name: "vX.Y.Z"}
        A->>P: Trigger repository_dispatch event
        P->>G: Fetch raw release notes
        P->>P: Transform with Claude Code Action
        P->>G: Update release with polished notes
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +74 to +76
gh api repos/${{ github.repository }}/dispatches \
--method POST \
--input - <<< "{\"event_type\":\"polish-release-notes\",\"client_payload\":{\"tag_name\":\"$TAG\"}}"
Copy link

Choose a reason for hiding this comment

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

style: The $TAG variable is directly interpolated into JSON without proper escaping. If the tag contains special characters (quotes, backslashes), this could produce invalid JSON.

Suggested change
gh api repos/${{ github.repository }}/dispatches \
--method POST \
--input - <<< "{\"event_type\":\"polish-release-notes\",\"client_payload\":{\"tag_name\":\"$TAG\"}}"
gh api repos/${{ github.repository }}/dispatches \
--method POST \
--field event_type=polish-release-notes \
--field "client_payload[tag_name]=$TAG"
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release-prepare.yml
Line: 74:76

Comment:
**style:** The `$TAG` variable is directly interpolated into JSON without proper escaping. If the tag contains special characters (quotes, backslashes), this could produce invalid JSON.

```suggestion
          gh api repos/${{ github.repository }}/dispatches \
            --method POST \
            --field event_type=polish-release-notes \
            --field "client_payload[tag_name]=$TAG"
```

How can I resolve this? If you propose a fix, please make it concise.

@TabishB TabishB merged commit e137dd3 into main Jan 21, 2026
9 of 10 checks passed
@TabishB TabishB deleted the fix/use-repository-dispatch branch January 21, 2026 04:03
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