Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/polish-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Polish Release Notes
# Uses Claude to transform raw changelog into polished release notes.
# Triggered automatically by release-prepare after publishing, or manually.
on:
repository_dispatch:
types: [polish-release-notes]
workflow_dispatch:
inputs:
tag_name:
Expand All @@ -11,7 +13,8 @@ on:
type: string

env:
TAG_NAME: ${{ inputs.tag_name }}
# repository_dispatch passes tag via client_payload, workflow_dispatch via inputs
TAG_NAME: ${{ github.event.client_payload.tag_name || inputs.tag_name }}

permissions:
contents: write
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
# npm authentication handled via OIDC trusted publishing (no token needed)

# Trigger release notes polishing after a release is published
# Uses repository_dispatch instead of workflow_dispatch because:
# - workflow_dispatch requires actions:write permission (GitHub App doesn't have it)
# - repository_dispatch works with contents:write (which we already have)
- name: Polish release notes
if: steps.changesets.outputs.published == 'true'
env:
Expand All @@ -68,4 +71,6 @@ jobs:
# Get version from package.json (just bumped by changesets)
TAG="v$(jq -r .version package.json)"
echo "Triggering polish workflow for $TAG"
gh workflow run polish-release-notes.yml -f tag_name="$TAG"
gh api repos/${{ github.repository }}/dispatches \
--method POST \
--input - <<< "{\"event_type\":\"polish-release-notes\",\"client_payload\":{\"tag_name\":\"$TAG\"}}"
Comment on lines +74 to +76
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.

133 changes: 0 additions & 133 deletions .github/workflows/test-polish-dispatch.yml

This file was deleted.

Loading