chore: label weekend issue closures
This commit is contained in:
16
.github/workflows/issue-gate.yml
vendored
16
.github/workflows/issue-gate.yml
vendored
@@ -19,6 +19,8 @@ jobs:
|
||||
const VALID_CAPABILITIES = new Set(['issue', 'pr']);
|
||||
const issueAuthor = context.payload.issue.user.login;
|
||||
const defaultBranch = context.payload.repository.default_branch;
|
||||
const issueCreatedDay = new Date(context.payload.issue.created_at).getUTCDay();
|
||||
const isFridayThroughSunday = issueCreatedDay === 5 || issueCreatedDay === 6 || issueCreatedDay === 0;
|
||||
|
||||
if (issueAuthor.endsWith('[bot]') || issueAuthor === 'dependabot[bot]') {
|
||||
console.log(`Skipping bot: ${issueAuthor}`);
|
||||
@@ -96,6 +98,11 @@ jobs:
|
||||
|
||||
const message = [
|
||||
'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',
|
||||
]
|
||||
: []),
|
||||
'',
|
||||
`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.`,
|
||||
'',
|
||||
@@ -111,6 +118,15 @@ jobs:
|
||||
body: message,
|
||||
});
|
||||
|
||||
if (isFridayThroughSunday) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
labels: ['closed-because-weekend'],
|
||||
});
|
||||
}
|
||||
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
||||
@@ -14,6 +14,8 @@ If you use an agent, run it from the `pi-mono` root directory so it picks up `AG
|
||||
|
||||
All issues and PRs from new contributors are auto-closed by default.
|
||||
|
||||
Issues submitted Friday through Sunday are not reviewed. If something 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 below will not be reopened or receive a reply.
|
||||
|
||||
Approval happens through maintainer replies on issues:
|
||||
|
||||
Reference in New Issue
Block a user