-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 987 Bytes
/
update-project-index.yml
File metadata and controls
35 lines (32 loc) · 987 Bytes
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
name: Update project index
on:
push:
branches:
- main
paths:
- "pages/**"
- "scripts/generate-project-index.mjs"
- ".github/workflows/update-project-index.yml"
workflow_dispatch:
permissions:
contents: write
jobs:
update-project-index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: node scripts/generate-project-index.mjs
- name: Commit generated index
run: |
if git diff --quiet -- assets/data/projects.json assets/data/projects.js; then
echo "Project index is already up to date."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add assets/data/projects.json assets/data/projects.js
git commit -m "Update project index"
git push