diff --git a/dist/index.js b/dist/index.js index 0768436..141142e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9384,6 +9384,7 @@ function nationalSectionApprovingMember(labels, comments) { } const formatPercentage = (percentage) => (percentage ? `${percentage.toFixed(1)}%` : '-'); function run(context) { + var _a; return __awaiter(this, void 0, void 0, function* () { // We need ncc to detect the concatenation and include the template file // in the build @@ -9399,6 +9400,19 @@ function run(context) { console.error('Can\'t find the bot comment where the voting is taking place'); return; } + const deadlineMatch = (_a = voteComment.body) === null || _a === void 0 ? void 0 : _a.match(//); + if (deadlineMatch) { + const deadline = new Date(deadlineMatch[1]); + if (deadline > new Date()) { + yield octokit_1.default.issues.createComment({ + owner, + repo, + issue_number: number, + body: `The vote is still open until ${deadline.toUTCString()}.`, + }); + return; + } + } const reactions = yield octokit_1.default.reactions.listForIssueComment({ owner, repo, diff --git a/src/commands/voteEnd.ts b/src/commands/voteEnd.ts index de01b61..252993e 100644 --- a/src/commands/voteEnd.ts +++ b/src/commands/voteEnd.ts @@ -115,6 +115,21 @@ export default async function run(context: Context) { return; } + const deadlineMatch = voteComment.body?.match(//); + if (deadlineMatch) { + const deadline = new Date(deadlineMatch[1]!); + if (deadline > new Date()) { + await octokit.issues.createComment({ + owner, + repo, + issue_number: number, + body: `The vote is still open until ${deadline.toUTCString()}.`, + }); + + return; + } + } + const reactions = await octokit.reactions.listForIssueComment({ owner, repo,