-
Notifications
You must be signed in to change notification settings - Fork 2k
77 lines (75 loc) · 3.38 KB
/
mark-issue-stale.yml
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
name: 'Mark stale issues'
on:
schedule:
# Run every 6 hours at xx:30.
- cron: '30 */6 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Mark issues and pull requests as stale
id: stale
uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Message to be added to stale issues.
stale-issue-message: 'This issue is stale because 720 days have passed with no activity. A member of the Dotcom Product Ambassadors Guild will review and if required close this issue within 7 days. If you disagree and would like this issue to remain open, please provide additional context, updated reproduction steps and/or screenshots.'
# Days before issue is considered stale.
days-before-issue-stale: 720
# Override stale setting for PRs.
days-before-pr-stale: -1
# Exempted issue labels.
exempt-issue-labels: '[Pri] High,[Pri] BLOCKER,[Status] Keep Open,'
# Message to be added to stale PRs.
stale-pr-message: 'This PR has been marked as stale due to lack of activity within the last 30 days.'
# Exempted PR labels.
exempt-pr-labels: '[Pri] High,[Pri] BLOCKER,[Status] Keep Open'
# Disable auto-close of both issues and PRs.
days-before-close: -1
# Get issues in ascending (oldest first) order.
ascending: true
# Label to apply when issue is marked stale.
stale-issue-label: '[Status] Stale'
# Label to apply when PR is marked as stale.
stale-pr-label: '[Status] Stale'
# Increase number of operations executed per run.
operations-per-run: 525
- name: Build Stale issues list
id: stale-build-list
uses: actions/github-script@v6
env:
ISSUES: ${{ steps.stale.outputs.staled-issues-prs }}
with:
script: |
const staleIssues = JSON.parse( process.env.ISSUES );
let staleIssuesList = '';
staleIssues.forEach(function(issue) {
if ( true === issue.markedStaleThisRun ) {
staleIssuesList += `\\n- ${issue.title} (https://github.com/automattic/wp-calypso/issues/${issue.number})`;
}
});
return staleIssuesList;
- name: Post about Stale issues on Slack
id: stale-post-slack
uses: slackapi/[email protected]
if: ${{ fromJSON( steps.stale-build-list.outputs.result ) != '' }}
with:
channel-id: ${{ secrets.SLACK_QUALITY_CHANNEL }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "The following issues have just been marked as stale. Please review them and take appropriate action:\n ${{ fromJSON( steps.stale-build-list.outputs.result ) }}"
}
}
],
"text": "The following issues have just been marked as stale. Please review them and take appropriate action.",
"unfurl_links": false,
"unfurl_media": false
}
env:
SLACK_QUALITY_CHANNEL: ${{ secrets.SLACK_QUALITY_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}