-
Notifications
You must be signed in to change notification settings - Fork 10
32 lines (27 loc) · 947 Bytes
/
issue-assign.yml
File metadata and controls
32 lines (27 loc) · 947 Bytes
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
name: Auto Assign Issues
on:
issues:
types: [opened]
permissions:
issues: write
jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- name: Add needs-triage label if not present
uses: actions/github-script@v7
with:
script: |
const issue = context.payload.issue;
const labels = issue.labels.map(l => l.name);
// If no priority labels, add needs-triage
const priorityLabels = ['needs-triage', 'priority: high', 'priority: low', 'priority: critical'];
const hasPriority = labels.some(l => priorityLabels.includes(l));
if (!hasPriority && !labels.includes('needs-triage')) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['needs-triage']
});
}