-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (43 loc) · 1.38 KB
/
postman-metrics.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
name: Compare and Send Postman Fork Data
on:
schedule:
- cron: '0 10 ? * 1'
workflow_dispatch:
jobs:
compare-and-send-forks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch previous run's data from cache
uses: actions/cache/restore@v4
with:
path: ./tools/postman/openapi/fork-data.json
key: fork-data-${{ github.run_id }}
restore-keys: |
fork-data-
- name: Save previous run's data to file
working-directory: ./tools/postman/openapi
run: |
if [ -f fork-data.json ]; then
mv fork-data.json previous-fork-data.json
fi
- name: Fetch current fork data
working-directory: ./tools/postman
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
WORKSPACE_ID: ${{ secrets.WORKSPACE_ID }}
run: make fetch_forks
- name: Compare data.json with previous run's data
working-directory: ./tools/postman
run: make compare_forks
- name: Send fork data to Slack
working-directory: ./tools/postman
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: make send_forks
- name: Save current fork totals to cache
uses: actions/cache/save@v4
with:
path: ./tools/postman/openapi/fork-data.json
key: fork-data-${{ github.run_id }}