-
Notifications
You must be signed in to change notification settings - Fork 432
114 lines (108 loc) · 4.35 KB
/
issue-notifier.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Find stale issues
on:
workflow_dispatch:
schedule:
# UTC Time
- cron: "0 7 * * 4"
jobs:
fetch-issues:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
# List of repositories to fetch the issues
repo:
- ink
- cargo-contract
- substrate-contracts-node
- contracts-ui
- ink-docs
- smart-bench
- ink-waterfall
- ink-playground
- nft-marketplace-demo
- pallet-contracts-xcm
- link
- ink-examples
- useink
- awesome-ink
- squink-splash-beginner
- squink-splash-advanced
- ink-workshop
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.ISSUE_TRACKER_APP_ID }}
private_key: ${{ secrets.ISSUE_TRACKER_APP_KEY }}
- name: Fetch issues from ${{ matrix.repo }}
id: issue
uses: paritytech/stale-issues-finder@main
with:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
repo: ${{ matrix.repo }}
# Users to ignore if they are authors. They are separated by commas
ignoreAuthors: ascjones,HCastano,Robbepop,athei,agryaznov,SkymanOne,xermicus,statictype,DoubleOTheven,cmichi,safina12,lean-apple,juangirini,pgherveou
# only fetch issues that don't have any replies
noComments: true
# from today onwards. Increase this number to set how much time without interaction must pass for the issue to be analyzed
days-stale: 0
- run: mkdir outputs
- name: Write repo data
run: echo "$DATA" > "$FILE"
env:
DATA: ${{ steps.issue.outputs.data }}
FILE: outputs/${{ matrix.repo }}.json
- uses: actions/upload-artifact@v3
with:
name: outputs
path: outputs/*.json
message:
runs-on: ubuntu-latest
needs: fetch-issues
steps:
- name: Load outputs
uses: actions/download-artifact@v3
with:
name: outputs
path: outputs
- name: Combine outputs
id: issues
run: |
COMBINED=$(jq -s 'reduce .[] as $x ([]; . + $x)' outputs/*.json | tr '\n' ' ')
COUNT=$(echo $COMBINED | jq length)
echo "# There are $COUNT stale issues" >> $GITHUB_STEP_SUMMARY
echo "ISSUES=$COMBINED" >> $GITHUB_OUTPUT
echo "COUNT=$COUNT" >> $GITHUB_OUTPUT
- name: Filter to the oldest issues
id: message
# Modify the number in reverse[:8] to change how many issues should be shown
run: |
if [ $COUNT = "0" ]; then
echo "MESSAGE=$EMPTY_MESSAGE" >> $GITHUB_OUTPUT
else
MESSAGE=$(echo $COMBINED | jq -r '. | sort_by(.daysStale) | reverse[:8]| to_entries | .[] | "\(.key). [\(.value.title)](\(.value.url)) | \(.value.daysStale) days with no reply"')
delimiter="$(openssl rand -hex 8)"
echo "MESSAGE<<${delimiter}" >> "${GITHUB_OUTPUT}"
echo "$MESSAGE" >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
fi
env:
COMBINED: ${{ steps.issues.outputs.ISSUES }}
COUNT: ${{ steps.issues.outputs.COUNT }}
# This is the message that will be shown when there are no
EMPTY_MESSAGE: "No stale issues! Good job!"
- name: send message
uses: s3krit/[email protected]
with:
room_id: "!EBuECvRavzBxijipBi:parity.io"
access_token: ${{ secrets.STALE_MATRIX_ACCESS_TOKEN }}
# Remember to keep at least one empty line between paragraphs
message: |
## Good morning, team 🥞!
This weekly digest lists GitHub issues without any reply that were created by non-team members.
The list is an aggregation of repositories which the Smart Contracts ☂️ owns ([list](https://www.notion.so/paritytechnologies/What-belongs-to-our-umbrella-b9a80b72fedc47d6b35224a15bdec64c)).
${{ steps.message.outputs.MESSAGE }}
Unfortunately there are more stale issues. The above list is limited to 8 entries. Find all the stale issues [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
server: "m.parity.io"