Skip to content

Commit 401f7ce

Browse files
committed
ci: add issue triage and stale management workflows
Add two GitHub Actions workflows for issue lifecycle management: - needs-triage.yml: automatically labels new human-created issues with "needs-triage" (excludes bot accounts) - stale.yml: marks inactive issues/PRs as stale after 60 days and auto-closes after 14 more days ("priority: high" is exempt)
1 parent 9396e6f commit 401f7ce

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/needs-triage.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Add needs-triage label
2+
on:
3+
issues:
4+
types: [opened]
5+
6+
permissions:
7+
issues: write
8+
9+
jobs:
10+
add-label:
11+
if: ${{ !endsWith(github.event.issue.user.login, '[bot]') }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/github-script@v7
15+
with:
16+
script: |
17+
await github.rest.issues.addLabels({
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
issue_number: context.issue.number,
21+
labels: ['needs-triage']
22+
});

.github/workflows/stale.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Close stale issues and PRs
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
permissions:
7+
issues: write
8+
pull-requests: write
9+
10+
jobs:
11+
stale:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/stale@v9
15+
with:
16+
days-before-stale: 60
17+
days-before-close: 14
18+
stale-issue-label: stale
19+
stale-pr-label: stale
20+
stale-issue-message: >
21+
This issue has been automatically marked as stale because it has not had
22+
recent activity. It will be closed if no further activity occurs within 14 days.
23+
stale-pr-message: >
24+
This PR has been automatically marked as stale because it has not had
25+
recent activity. It will be closed if no further activity occurs within 14 days.
26+
exempt-issue-labels: 'priority: high'
27+
exempt-pr-labels: 'priority: high'

0 commit comments

Comments
 (0)