Skip to content

Commit bb8619c

Browse files
Fix incorrect package.json path in auto-bumper workflow
Updated the auto-bumper GitHub Actions workflow to point to the root-level `package.json` instead of the nested `surveyjs-builder` path. This ensures the correct package file is referenced during automated operations.
1 parent 3f71eee commit bb8619c

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

.github/workflows/auto-bumper.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,49 @@ jobs:
1616
if: (contains( github.event.pull_request.labels.*.name, 'auto-bump') || (contains(github.event.comment.body, '@github-bot') && contains(github.event.comment.body, 'bump')))
1717
steps:
1818

19+
- name: React 👍 to triggering comment
20+
uses: actions/github-script@v7
21+
with:
22+
script: |
23+
const { eventName, repo, payload } = context;
24+
const { owner, repo: repoName } = repo;
25+
26+
const commentId = payload?.comment?.id;
27+
if (!commentId) {
28+
core.setFailed('No triggering comment found in payload.');
29+
return;
30+
}
31+
32+
if (eventName === 'issue_comment') {
33+
await github.rest.reactions.createForIssueComment({
34+
owner,
35+
repo: repoName,
36+
comment_id: commentId,
37+
content: '+1',
38+
});
39+
} else if (eventName === 'pull_request_review_comment') {
40+
await github.rest.reactions.createForPullRequestReviewComment({
41+
owner,
42+
repo: repoName,
43+
comment_id: commentId,
44+
content: '+1',
45+
});
46+
} else {
47+
core.setFailed(`Unsupported event: ${eventName}. Use issue_comment or pull_request_review_comment.`);
48+
}
49+
1950
- name: Add comment to PR
2051
uses: actions/github-script@v7
2152
with:
2253
script: |
2354
const fs = require('fs');
2455
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
25-
// 1) Create the comment
26-
const { data: comment } = await github.rest.issues.createComment({
56+
github.rest.issues.createComment({
2757
issue_number: context.issue.number,
2858
owner: context.repo.owner,
2959
repo: context.repo.repo,
3060
body: `Okay boss, ⏳ Bumping version to ${pkg.version}...`
31-
});
32-
33-
// 2) React to that comment with a thumbs-up
34-
await github.rest.reactions.createForIssueComment({
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
comment_id: comment.id,
38-
content: '+1' // 👍
39-
});
40-
61+
})
4162
4263
- name: Checkout
4364
uses: actions/checkout@v4

0 commit comments

Comments
 (0)