Skip to content

Commit 0772204

Browse files
committed
fix: rename all bot scripts to .cjs to avoid ES module scope errors
1 parent 2fef7e3 commit 0772204

51 files changed

Lines changed: 160 additions & 160 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/bot-inactivity-comments.js renamed to .github/scripts/bot-inactivity-comments.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-inactivity-comments.js
3+
// bot-inactivity-comments.cjs
44
//
55
// Comment builders for the inactivity bot. Pure formatting functions
66
// separated from the scheduled execution logic for readability.
77
//
88
// Duration values (WARN_AFTER_MS, CLOSE_AFTER_MS, BLOCKED_CHECKIN_AFTER_MS)
9-
// remain in bot-inactivity.js and are passed in as parameters here so this
9+
// remain in bot-inactivity.cjs and are passed in as parameters here so this
1010
// file stays free of module-level constants that belong to the scheduler.
1111

1212
const { LABELS } = require('./helpers/constants');
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-inactivity.js
3+
// bot-inactivity.cjs
44
//
55
// Scheduled inactivity bot. Runs daily to detect stale assigned issues and PRs.
66
//
@@ -306,7 +306,7 @@ async function computeIssueLastActivity(github, owner, repo, issue, linkedOpenPR
306306
return latest;
307307
}
308308

309-
// ─── (Comment builders moved to bot-inactivity-comments.js) ─────────────────
309+
// ─── (Comment builders moved to bot-inactivity-comments.cjs) ─────────────────
310310

311311
// ─── State mutation ───────────────────────────────────────────────────────────
312312

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-comment.js
3+
// bot-on-comment.cjs
44
//
55
// Handles issue comment events: reads the comment body, parses commands, and dispatches
66
// to the appropriate handler. Implemented commands: /assign, /unassign, /finalize.
77
//
8-
// /assign: see commands/assign.js (skill levels, assignment limits, required labels).
9-
// /unassign: see commands/unassign.js (authorization, label reversion).
10-
// /finalize: see commands/finalize.js (triage permission required; validates labels,
8+
// /assign: see commands/assign.cjs (skill levels, assignment limits, required labels).
9+
// /unassign: see commands/unassign.cjs (authorization, label reversion).
10+
// /finalize: see commands/finalize.cjs (triage permission required; validates labels,
1111
// updates issue title/body with skill-level format, swaps status labels).
1212

1313
const { createLogger, buildBotContext } = require('./helpers');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-pr-close.js
3+
// bot-on-pr-close.cjs
44
//
55
// Handles pull_request close events and triggers post-merge automation.
66
//
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-pr-merged.js
3+
// bot-on-pr-merged.cjs
44
//
55
// Handles pull_request closed events where the PR was merged.
66
// Updates the dashboard comments of sibling PRs when a newly merged PR
@@ -80,10 +80,10 @@ module.exports = async ({ github, context }) => {
8080
return;
8181
}
8282

83-
// Decision: Sibling-conflict check is placed in a dedicated `bot-on-pr-merged.js` script
84-
// rather than appending it to `bot-on-pr-close.js`. This separates the core PR status
83+
// Decision: Sibling-conflict check is placed in a dedicated `bot-on-pr-merged.cjs` script
84+
// rather than appending it to `bot-on-pr-close.cjs`. This separates the core PR status
8585
// updates (conflicts/labels/dashboard) from the contributor workflow automation
86-
// (issue recommendation) handled by `bot-on-pr-close.js`.
86+
// (issue recommendation) handled by `bot-on-pr-close.cjs`.
8787
await checkSiblingConflictsOnMerge(botContext);
8888

8989
} catch (error) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-pr-open.js
3+
// bot-on-pr-open.cjs
44
//
55
// Runs when a PR is opened, reopened, or converted from draft (ready_for_review).
66
// Performs all 4 checks (DCO, GPG, merge conflict, issue link), posts/updates

.github/scripts/bot-on-pr-review-labels.js renamed to .github/scripts/bot-on-pr-review-labels.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-pr-review-labels.js
3+
// bot-on-pr-review-labels.cjs
44
//
55
// Triggered by workflow_run after "Bot - On PR Review" completes.
66
// Downloads the recorder artifact, reconstructs context, and delegates to
7-
// bot-on-pr-review.js to apply the correct status label.
7+
// bot-on-pr-review.cjs to apply the correct status label.
88

99
const fs = require('fs');
1010

1111
module.exports = async ({ github, context }) => {
1212
const data = JSON.parse(
13-
fs.readFileSync('review-event.json', 'utf8')
13+
fs.readFileSync('review-event.cjson', 'utf8')
1414
);
1515

1616
if (data.draft) {
@@ -35,6 +35,6 @@ module.exports = async ({ github, context }) => {
3535
},
3636
};
3737

38-
const bot = require('./bot-on-pr-review.js');
38+
const bot = require('./bot-on-pr-review.cjs');
3939
await bot({ github, context });
4040
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-pr-review.js
3+
// bot-on-pr-review.cjs
44
//
55
// Triggers on pull_request_review: submitted.
66
// When a maintainer requests changes, automatically swaps the needs-review label
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// bot-on-pr-update.js
3+
// bot-on-pr-update.cjs
44
//
55
// Runs on new commits (synchronize) and PR body edits (edited). Performs all
66
// 4 checks (DCO, GPG, merge conflict, issue link), posts/updates the unified

.github/scripts/bot/bot-recommend-issues.js renamed to .github/scripts/bot/bot-recommend-issues.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
//
3-
// commands/recommend-issues.js
3+
// commands/recommend-issues.cjs
44
//
55
// Issue recommendation command: suggests relevant issues to contributors
66
// after a PR is closed. Uses a history-based eligibility model to recommend issues strictly

0 commit comments

Comments
 (0)