Skip to content

Commit 7451941

Browse files
committed
Add issue opened, close action
1 parent 0eb8c1a commit 7451941

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Close inactive issues and PRs
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
workflow_dispatch:
6+
permissions: read-all
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
15+
with:
16+
only-labels: "status: waiting-for-feedback" # only consider issues and PRs with this label
17+
days-before-stale: 30 # 1 month
18+
days-before-close: 60 # 2 months after being stale
19+
stale-issue-label: "status: stale"
20+
stale-pr-label: "status: stale"
21+
stale-issue-message: >
22+
If you would like us to be able to process this issue, please provide the requested information.
23+
If the information is not provided within the next 2 months, we will be unable to proceed and this issue will be closed.
24+
close-issue-message: >
25+
Closing due to lack of requested feedback.
26+
If you would like to proceed with your contribution, please provide the requested information and we will re-open this issue.
27+
stale-pr-message: >
28+
If you would like us to be able to process this pull request, please provide the requested information or make the requested changes.
29+
If the information is not provided or the requested changes are not made within the next 3 weeks, we will be unable to proceed and this pull request will be closed.
30+
close-pr-message: >
31+
Closing due to lack of requested feedback.
32+
If you would like to proceed with your contribution, please provide the requested information or make the requested changes, and we will re-open this pull request.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Add label to opened issues
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
permissions: read-all
7+
jobs:
8+
label_issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
14+
with:
15+
script: |
16+
const issue = await github.rest.issues.get({
17+
issue_number: context.issue.number,
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
});
21+
const originalLabels = issue.data.labels.map(l => l.name);
22+
const statusLabels = originalLabels.filter(l => l.startsWith("status: "));
23+
if (statusLabels.length === 0) {
24+
github.rest.issues.addLabels({
25+
issue_number: context.issue.number,
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
labels: ["status: new"]
29+
})
30+
}

0 commit comments

Comments
 (0)