Skip to content

Commit aa5872c

Browse files
ci: fix comment-on-release syntax (#308)
* ci: fix comment-on-release syntax * Test in PR * Remove condition * Fix permissions * Add GH_TOKEN * Fix gh pr comment * Quote comment * Undo test changes
1 parent c0300ba commit aa5872c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/comment-on-release/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ runs:
99
steps:
1010
- name: Comment on PRs
1111
shell: bash
12+
run: node ${{ github.action_path }}/comment-on-release.ts
1213
env:
1314
PUBLISHED_PACKAGES: ${{ inputs.published-packages }}
1415
REPOSITORY: ${{ github.repository }}
15-
run: node {{ github.action_path }}/comment-on-release.ts
16+
GH_TOKEN: ${{ github.token }}

.github/comment-on-release/comment-on-release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async function commentOnPR(pr: PRInfo, repository: string): Promise<void> {
118118

119119
try {
120120
// Use gh CLI to post the comment
121-
execSync(`gh pr comment ${number} --body ${JSON.stringify(comment)}`, {
121+
execSync(`gh pr comment ${number} --body '${comment.replace(/'/g, '"')}'`, {
122122
stdio: 'inherit',
123123
})
124124
console.log(`✓ Commented on PR #${number}`)

0 commit comments

Comments
 (0)