Repository navigation
74 lines (67 loc) · 2.42 KB
/
Copy pathclose-stale-issues.yml
File metadata and controls
74 lines (67 loc) · 2.42 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Close stale issues
# A `ready-for-pr` issue loses an assignee who opens no pull request, and later loses the label if nobody works on it.
# A `needs-info` issue closes if its author does not reply in a comment.
on:
schedule:
- cron: '45 6 * * *'
workflow_dispatch:
inputs:
dry-run:
description: Log the actions and change no issue
type: boolean
default: true
permissions:
contents: read
issues: write
env:
DAYS_BEFORE_UNASSIGN: 30
DAYS_BEFORE_UNREADY: 180
DAYS_BEFORE_NEEDS_INFO_CLOSE: 21
jobs:
release-stale-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
sparse-checkout: |
.github/scripts
.github/automation-messages
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
env:
# A scheduled run has no inputs, so it acts for real
DRY_RUN: ${{ inputs.dry-run || false }}
with:
script: |
const { default: releaseStaleIssues } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/release-stale-issues.mjs`);
await releaseStaleIssues({
github,
context,
core,
daysBeforeUnassign: Number(process.env.DAYS_BEFORE_UNASSIGN),
daysBeforeUnready: Number(process.env.DAYS_BEFORE_UNREADY),
dryRun: process.env.DRY_RUN === 'true'
});
close-needs-info-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
sparse-checkout: |
.github/scripts
.github/automation-messages
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
env:
# A scheduled run has no inputs, so it acts for real
DRY_RUN: ${{ inputs.dry-run || false }}
with:
script: |
const { default: closeStaleIssues } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/close-stale-issues.mjs`);
await closeStaleIssues({
github,
context,
core,
daysBeforeClose: Number(process.env.DAYS_BEFORE_NEEDS_INFO_CLOSE),
dryRun: process.env.DRY_RUN === 'true'
});