aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-01 02:26:52 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-01 02:26:52 +0300
commit0a949e0ebccc54a0c0212191a2c788bbad9539ce (patch)
tree638b00ddb4670bfb15af4c9bb6f7db0c5b87cd66 /.github/workflows
parent472e2b8453160affd05760b22a483b3c9ee100be (diff)
fix: request missing issue environment details
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/issue-gate.yml38
1 files changed, 29 insertions, 9 deletions
diff --git a/.github/workflows/issue-gate.yml b/.github/workflows/issue-gate.yml
index 52f6a150..d8356e77 100644
--- a/.github/workflows/issue-gate.yml
+++ b/.github/workflows/issue-gate.yml
@@ -31,9 +31,9 @@ jobs:
'### Environment',
];
const requiredEnvironmentFields = [
- /^\s*-\s*Herdr version:\s*\S.*$/m,
- /^\s*-\s*Operating system:\s*\S.*$/m,
- /^\s*-\s*Terminal:\s*\S.*$/m,
+ /^\s*(?:-\s*)?Herdr version:[^\S\r\n]*\S.*$/m,
+ /^\s*(?:-\s*)?Operating system:[^\S\r\n]*\S.*$/m,
+ /^\s*(?:-\s*)?Terminal:[^\S\r\n]*\S.*$/m,
];
function escapeRegExp(value) {
@@ -112,20 +112,40 @@ jobs:
return;
}
+ if (hasBugConfirmation && hasBugTemplate && hasRequiredContent && !hasEnvironmentFields) {
+ const message = [
+ `hi @${author}, thanks for opening this.`,
+ '',
+ 'this bug report is missing required environment details. please edit the issue and fill in herdr version, operating system, and terminal.',
+ '',
+ 'shell and relevant config are optional, but they help when they affect the bug.',
+ ].join('\n');
+
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: issue.number,
+ body: message,
+ });
+
+ console.log(`#${issue.number} is missing required environment details; leaving issue open for correction`);
+ return;
+ }
+
const message = [
- `Hi @${author}, thanks for opening this.`,
+ `hi @${author}, thanks for opening this.`,
'',
- 'This issue does not appear to use the full bug report template. Herdr issues are only for reproducible bugs and maintainer-created or maintainer-converted work items.',
+ 'this issue does not appear to use the full bug report template. herdr issues are only for reproducible bugs and maintainer-created or maintainer-converted work items.',
'',
- 'Bug reports must include the reproducible-bug confirmation, current behavior, expected behavior, reproduction, impact, and environment fields with Herdr version, operating system, and terminal.',
+ 'bug reports must include the reproducible-bug confirmation, current behavior, expected behavior, reproduction, impact, and environment fields with herdr version, operating system, and terminal.',
'',
- 'Feature requests, ideas, questions, contribution proposals, and direction checks belong in Discussions:',
+ 'feature requests, ideas, questions, contribution proposals, and direction checks belong in discussions:',
`https://github.com/${context.repo.owner}/${context.repo.repo}/discussions`,
'',
- 'Please read the contributing guidelines before opening issues or PRs:',
+ 'please read the contributing guidelines before opening issues or prs:',
`https://github.com/${context.repo.owner}/${context.repo.repo}/blob/${context.payload.repository.default_branch}/CONTRIBUTING.md`,
'',
- 'Closing this so the issue tracker stays limited to actionable bug reports.',
+ 'closing this so the issue tracker stays limited to actionable bug reports.',
].join('\n');
await github.rest.issues.createComment({