forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (75 loc) · 3.44 KB
/
Copy pathstale.yml
File metadata and controls
80 lines (75 loc) · 3.44 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
75
76
77
78
79
80
name: Mark stale issues and pull requests
on:
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-24.04
outputs:
staled_prs: ${{ steps.filter-prs.outputs.result }}
steps:
- name: Mark stale issues and pull requests
uses: actions/stale@v10
id: stale
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: "This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~7 days. Please address any outstanding review items and ensure your PR is finished - if both are true, and you have auto-staled anyway, you need to actively ask maintainers (by pinging them in the /tg/station Discord) to (re)review or merge your PR. If no maintainer responds to your request, you may wish to close this PR yourself while you seek maintainer comment, as you will later be able to reopen the PR yourself."
stale-issue-message: "This issue has been marked for cleanup and will be automatically closed in ~14 days. If there is evidence that the issue still occurs, leave a comment with it attached and contact an issue manager or maintainer to have the label removed."
days-before-stale: 7
days-before-close: 7
days-before-issue-stale: 14
days-before-issue-close: 14
stale-pr-label: "Stale"
stale-issue-label: "Stale"
any-of-issue-labels: "Cleanup Flagged,🤖 Flaky Test Report"
remove-issue-stale-when-updated: false
exempt-issue-labels: "RED LABEL"
exempt-pr-labels: "RED LABEL,Good First PR"
operations-per-run: 300
- name: Filter staled pull requests for announcement
id: filter-prs
uses: actions/github-script@v9
env:
input: ${{steps.stale.outputs.staled-issues-prs}}
with:
script: |
return JSON.parse(process.env.input)
.filter(issue => !!issue.pull_request)
.map(pr => ({
title: pr.title,
number: pr.number,
html_url: pr.pull_request.html_url,
}));
announce:
runs-on: ubuntu-24.04
needs: stale
if: ${{ needs.stale.outputs.staled_prs != '[]' }}
strategy:
matrix:
pull_request: ${{ fromJSON(needs.stale.outputs.staled_prs) }}
steps:
- name: "Check for DISCORD_WEBHOOK"
id: secrets_set
env:
ENABLER_SECRET: ${{ secrets.DISCORD_WEBHOOK }}
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "SECRETS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Send Discord notification
uses: tgstation/discord-notify@main
if: >
steps.secrets_set.outputs.SECRETS_ENABLED
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
title: ${{ matrix.pull_request.title }}
message: ${{ format('**Pull Request \#{0} automatically marked as stale.**', matrix.pull_request.number) }}
include_image: false
show_author: false
avatar_url: https://avatars.githubusercontent.com/u/1363778?s=200&v=4
title_url: ${{ matrix.pull_request.html_url }}