generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
119 lines (117 loc) · 4.03 KB
/
generate-periodic-report.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
115
116
117
118
119
name: Periodically run module-lint and report results
# Runs at minute 10 of the 1st hour of every Sunday
on:
schedule:
- cron: '10 1 * * 0'
workflow_dispatch:
jobs:
run-module-lint:
name: Run module-lint
runs-on: ubuntu-latest
strategy:
matrix:
project:
- auto-changelog
- create-release-branch
- module-lint
- utils
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Run module-lint
id: module-lint
run: .github/scripts/run-module-lint.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_NAME: ${{ matrix.project }}
MODULE_LINT_RUNS_DIRECTORY: /tmp/module-lint-runs
- name: Save report
uses: actions/upload-artifact@v4
with:
name: module-lint-report--${{ matrix.project }}
path: /tmp/module-lint-runs
post-initial-message-to-slack:
name: Post initial message to Slack
needs: run-module-lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Load results for previous module-lint runs
uses: actions/download-artifact@v4
with:
path: /tmp/module-lint-runs
pattern: module-lint-report--*
merge-multiple: true
- name: Determine Slack payload
id: slack-payload
run: yarn tsx ./.github/scripts/determine-initial-slack-payload.ts
env:
MODULE_LINT_RUNS_DIRECTORY: /tmp/module-lint-runs
SLACK_CHANNEL_ID: C074PNYH0R4 # Channel: #wallet-framework-automations
- name: Post to Slack
id: initial-slack-message
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
channel-id: C074PNYH0R4 # Channel: #wallet-framework-automations
payload: ${{ steps.slack-payload.outputs.SLACK_PAYLOAD }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
outputs:
slack-thread-ts: ${{ steps.initial-slack-message.outputs.ts }}
post-threaded-message-to-slack:
name: Post threaded message to Slack
needs: post-initial-message-to-slack
runs-on: ubuntu-latest
strategy:
matrix:
project:
- auto-changelog
- create-release-branch
- module-lint
- utils
steps:
- name: Load report for previous module-lint-run
id: load-report
uses: actions/download-artifact@v4
with:
name: module-lint-report--${{ matrix.project }}
path: /tmp/module-lint-runs
- name: Check out repository
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Determine Slack payload
id: slack-payload
run: yarn tsx ./.github/scripts/determine-slack-payload-for-package.ts
env:
PROJECT_NAME: ${{ matrix.project }}
MODULE_LINT_RUNS_DIRECTORY: ${{ steps.load-report.outputs.download-path }}
SLACK_CHANNEL_ID: C074PNYH0R4 # Channel: #wallet-framework-automations
SLACK_THREAD_TS: ${{ needs.post-initial-message-to-slack.outputs.slack-thread-ts }}
- name: Post to Slack
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
with:
channel-id: C074PNYH0R4 # Channel: #wallet-framework-automations
payload: ${{ steps.slack-payload.outputs.SLACK_PAYLOAD }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}