-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (51 loc) · 1.91 KB
/
generate-data.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: generate-data
on:
push:
branches: [main]
paths:
- "data/*.json"
- "src/pages/blog/*.mdx"
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
- uses: tj-actions/changed-files@v43
id: changed-files
with:
files: |
data/*.json
src/content/blog/*.mdx
- name: achievements
if: contains(steps.changed-files.outputs.modified_files, 'data/achievements.json')
run: node scripts/achievements.mjs
- name: articles
if: contains(steps.changed-files.outputs.modified_files, 'data/articles.json') || contains(steps.changed-files.outputs.modified_files, 'src/content/blog')
run: node scripts/articles.mjs
- name: jobs
if: contains(steps.changed-files.outputs.modified_files, 'data/jobs.json')
run: node scripts/jobs.mjs
- name: podcasts
if: contains(steps.changed-files.outputs.modified_files, 'data/podcasts.json')
run: node scripts/podcasts.mjs
- name: repos
if: contains(steps.changed-files.outputs.modified_files, 'data/repos.json')
run: node scripts/repos.mjs
- name: talks
if: contains(steps.changed-files.outputs.modified_files, 'data/talks.json')
run: node scripts/talks.mjs
- run: pnpm fmt
- name: Commit to repository
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COMMIT_MSG: |
update generated data
run: |
git config user.email "[email protected]"
git config user.name "hiroppy-bot"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git checkout main
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin main)