-
Notifications
You must be signed in to change notification settings - Fork 11
70 lines (59 loc) · 2.18 KB
/
analyze.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
name: Analyze Webref data
on:
workflow_dispatch:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install pandoc
run: sudo apt-get install pandoc
- name: Install Strudy
run: npm install strudy
- name: Checkout webref
uses: actions/checkout@v2
with:
repository: w3c/webref
ref: main
fetch-depth: 1
path: webref
- name: Checkout current reports
uses: actions/checkout@v2
with:
repository: w3c/webref-analysis
path: webref-analysis
- name: Run Strudy on Webref data
run: node_modules/.bin/strudy webref/ed > webref-analysis/index.json
- name: Generate Markdown reports
run: |
node_modules/.bin/strudy webref-analysis/index.json --format markdown > webref-analysis/index.md
node_modules/.bin/strudy webref-analysis/index.json --format markdown --perissue > webref-analysis/perissue.md
- name: Generate HTML reports
run: |
node_modules/.bin/strudy webref-analysis/index.json --format html > webref-analysis/index.html
node_modules/.bin/strudy webref-analysis/index.json --format html --perissue > webref-analysis/perissue.html
- name: Create diff report
run: |
node_modules/.bin/strudy webref-analysis/index.json --diff https://w3c.github.io/webref-analysis/index.json > webref-analysis/diff.md
- name: Push new reports to git
run: |
git config user.name "webref-analysis-bot"
git config user.email "<>"
git remote set-url --push origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
DIFF=$(git diff | sed 's/^[ ]*//' | sed 's/[ ]*$//')
if [ -n "$DIFF" ]; then
echo "DIFF=$DIFF"
git add -A
WEBREF_SHA=$(git --git-dir=../webref/.git rev-parse HEAD)
git commit -m "Update study reports from Webref data" -m "Using Webref commit $WEBREF_SHA."
git push origin HEAD:main
else
echo "No diff to push"
fi
working-directory: webref-analysis