Skip to content

Commit 8a350f9

Browse files
committed
fix(ci): fix PR comment step for workflow_dispatch — use pr_number input [skip ci]
1 parent c74b8f7 commit 8a350f9

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/weblate-build-check.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,20 @@ jobs:
101101
if: success()
102102
with:
103103
script: |
104+
// workflow_dispatch passes pr_number as input; PR events use context.issue.number
105+
const prNumber = context.payload.inputs?.pr_number
106+
? parseInt(context.payload.inputs.pr_number)
107+
: context.issue.number;
108+
if (!prNumber) {
109+
core.warning('No PR number available — skipping comment');
110+
return;
111+
}
104112
github.rest.issues.createComment({
105-
issue_number: context.issue.number,
113+
issue_number: prNumber,
106114
owner: context.repo.owner,
107115
repo: context.repo.repo,
108-
body: `## ✅ Translation Build successful!
109-
110-
The translation PR was built and tested successfully.
111-
112-
**Next step:** Perform squash-merge.
113-
114-
> Don't forget to update \`locales_config.xml\` if a new language was added.`
116+
body: '## \u2705 Translation Build successful!\n\n' +
117+
'The translation PR was built and tested successfully.\n\n' +
118+
'**Next step:** Perform squash-merge.\n\n' +
119+
'> Don\'t forget to update `locales_config.xml` if a new language was added.'
115120
})

0 commit comments

Comments
 (0)