-
Notifications
You must be signed in to change notification settings - Fork 455
52 lines (44 loc) · 1.24 KB
/
Copy pathgenerate-entries-json.yml
File metadata and controls
52 lines (44 loc) · 1.24 KB
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: Generate Entries JS
on:
push:
paths:
- 'entries/**/*.html'
branches: [ master ]
pull_request:
paths:
- 'entries/**/*.html'
branches: [ master ]
workflow_dispatch:
jobs:
generate-entries-js:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: |
npm install jsdom cheerio
- name: Generate entries.js
run: node .github/scripts/generate-entries-json.js
- name: Check if entries.js changed
id: check-changes
run: |
if git diff --quiet entries.js; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push entries.js
if: steps.check-changes.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add entries.js
git commit -m "Auto-update entries.js from HTML metadata"
git push