-
Notifications
You must be signed in to change notification settings - Fork 411
60 lines (51 loc) · 2.33 KB
/
issue-triage.yml
File metadata and controls
60 lines (51 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Issue Triage Gate
on:
issues:
types: [opened]
permissions:
issues: write
jobs:
check-agent-diagnostic:
runs-on: ubuntu-latest
# Only run on bug reports (title starts with "bug:")
if: startsWith(github.event.issue.title, 'bug:')
steps:
- name: Check for agent diagnostic section
uses: actions/github-script@v7
with:
script: |
const body = context.payload.issue.body || '';
// Check if the Agent Diagnostic section has substantive content.
// The template placeholder starts with "Example:" — if that's still
// there or the section is empty, the reporter didn't fill it in.
const diagnosticMatch = body.match(
/### Agent Diagnostic\s*\n([\s\S]*?)(?=\n### |\n$)/
);
const hasSubstantiveDiagnostic = diagnosticMatch
&& diagnosticMatch[1].trim().length > 0
&& !diagnosticMatch[1].trim().startsWith('Example:');
if (hasSubstantiveDiagnostic) {
console.log('Agent diagnostic section found with content. Passing.');
return;
}
console.log('Agent diagnostic section missing or placeholder. Flagging.');
// Add state:triage-needed label
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['state:triage-needed']
});
// Post redirect comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: [
'This issue appears to have been opened without an agent investigation.',
'',
'OpenShell is an agent-first project - please point your coding agent at the repo and have it diagnose this before we triage. Your agent can load skills like `debug-openshell-cluster`, `debug-inference`, `openshell-cli`, and `generate-sandbox-policy`.',
'',
'See [CONTRIBUTING.md](https://github.com/NVIDIA/OpenShell/blob/main/CONTRIBUTING.md#before-you-open-an-issue) for the full workflow.',
].join('\n')
});