Skip to content

Commit e7e6cad

Browse files
committed
dashboard: Add view for PR runs
Added a script that fetches PR data and created a separate view on the dashboard. Tweaked dotenv require. Fixes #1 Signed-off-by: Anna Finn <[email protected]>
1 parent ff45e30 commit e7e6cad

File tree

4 files changed

+590
-244
lines changed

4 files changed

+590
-244
lines changed

.github/workflows/fectch-ci-data.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Fetch CI Data
2+
run-name: Fetch CI Data
3+
on:
4+
schedule:
5+
- cron: '0 */2 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
fetch-and-commit-data:
10+
runs-on: ubuntu-22.04
11+
12+
env:
13+
NODE_ENV: production
14+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Update dashboard data
20+
run: |
21+
# fetch ci nightly data as temporary file
22+
node scripts/fetch-ci-nightly-data.js | tee tmp-data.json
23+
node scripts/fetch-ci-pr-data.js | tee tmp-data2.json
24+
25+
# switch to a branch specifically for holding latest data
26+
git config --global user.name "GH Actions Workflow"
27+
git config --global user.email "<gha@runner>"
28+
git fetch --all
29+
git checkout latest-dashboard-data
30+
31+
# back out whatever data was there
32+
git reset HEAD~1
33+
34+
# overwrite the old data
35+
mkdir -p data/
36+
mv tmp-data.json data/job_stats.json
37+
mv tmp-data2.json data/check_stats.json
38+
39+
# commit
40+
git add data
41+
git commit -m '[skip ci] latest ci nightly data'
42+
git push --force

0 commit comments

Comments
 (0)