chore: update temporary issue gate message
This commit is contained in:
45
.github/workflows/issue-gate.yml
vendored
45
.github/workflows/issue-gate.yml
vendored
@@ -17,6 +17,7 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
const APPROVED_FILE = '.github/APPROVED_CONTRIBUTORS';
|
const APPROVED_FILE = '.github/APPROVED_CONTRIBUTORS';
|
||||||
const VALID_CAPABILITIES = new Set(['issue', 'pr']);
|
const VALID_CAPABILITIES = new Set(['issue', 'pr']);
|
||||||
|
const ISSUE_GATE_MESSAGE_MODE = 'refactor'; // Switch to 'normal' to restore the standard auto-close message.
|
||||||
const issueAuthor = context.payload.issue.user.login;
|
const issueAuthor = context.payload.issue.user.login;
|
||||||
const defaultBranch = context.payload.repository.default_branch;
|
const defaultBranch = context.payload.repository.default_branch;
|
||||||
const issueCreatedDay = new Date(context.payload.issue.created_at).getUTCDay();
|
const issueCreatedDay = new Date(context.payload.issue.created_at).getUTCDay();
|
||||||
@@ -96,20 +97,36 @@ jobs:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const message = [
|
function buildNormalGateMessage() {
|
||||||
'This issue was auto-closed. All issues from new contributors are auto-closed by default.',
|
return [
|
||||||
...(isFridayThroughSunday
|
'This issue was auto-closed. All issues from new contributors are auto-closed by default.',
|
||||||
? [
|
...(isFridayThroughSunday
|
||||||
'Issues submitted Friday through Sunday are not reviewed. If this is urgent, ask on Discord: https://discord.com/invite/3cU7Bz4UPx',
|
? [
|
||||||
]
|
'Issues submitted Friday through Sunday are not reviewed. If this is urgent, ask on Discord: https://discord.com/invite/3cU7Bz4UPx',
|
||||||
: []),
|
]
|
||||||
'',
|
: []),
|
||||||
`Maintainers review auto-closed issues daily and reopen worthwhile ones. Issues that do not meet the quality bar in [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${defaultBranch}/CONTRIBUTING.md) will not be reopened or receive a reply.`,
|
'',
|
||||||
'',
|
`Maintainers review auto-closed issues daily and reopen worthwhile ones. Issues that do not meet the quality bar in [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${defaultBranch}/CONTRIBUTING.md) will not be reopened or receive a reply.`,
|
||||||
'If a maintainer replies `lgtmi` on one of your issues, your future issues will stay open. If a maintainer replies `lgtm`, your future issues and PRs will stay open.',
|
'',
|
||||||
'',
|
'If a maintainer replies `lgtmi` on one of your issues, your future issues will stay open. If a maintainer replies `lgtm`, your future issues and PRs will stay open.',
|
||||||
`See [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${defaultBranch}/CONTRIBUTING.md).`,
|
'',
|
||||||
].join('\n');
|
`See [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${defaultBranch}/CONTRIBUTING.md).`,
|
||||||
|
].join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildRefactorGateMessage() {
|
||||||
|
return [
|
||||||
|
'This issue was auto-closed. All issues will be closed until 2026-05-17 because the project is undergoing a large refactor.',
|
||||||
|
'',
|
||||||
|
`See the \`bigrefactor\` branch: https://github.com/${context.repo.owner}/${context.repo.repo}/tree/bigrefactor`,
|
||||||
|
'',
|
||||||
|
'Issues closed during this period will not be reviewed. The reason is that the refactor will not get done otherwise, because issue triage has been taking about 8 hours per day.',
|
||||||
|
'',
|
||||||
|
'In case of emergency, ask on Discord: https://discord.com/invite/3cU7Bz4UPx',
|
||||||
|
].join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = ISSUE_GATE_MESSAGE_MODE === 'refactor' ? buildRefactorGateMessage() : buildNormalGateMessage();
|
||||||
|
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
|
|||||||
Reference in New Issue
Block a user