chore: label weekend issue closures

This commit is contained in:
Mario Zechner
2026-04-24 13:57:55 +02:00
parent 7bd9f6500d
commit b38e546e90
2 changed files with 18 additions and 0 deletions

View File

@@ -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,

View File

@@ -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: