Repository navigation
55 lines (53 loc) · 1.87 KB
/
Copy pathsync-github.yml
File metadata and controls
55 lines (53 loc) · 1.87 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
53
54
55
name: Sync GitHub
on:
schedule:
- cron: "0 3 * * 0"
# A record merged on Monday used to wait until Sunday for its first
# metadata sync. With no stars and no pushedAt it sorted last on every
# order the directory offers — including "Recently added", where it
# belonged at the top. Sync as soon as a record lands instead. Records
# are Markdown files in content/records/; the few left as YAML are in
# data/records/.
push:
branches: [main]
paths:
- "content/records/**"
- "data/records/**"
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: pnpm
- run: pnpm install --frozen-lockfile
# --strict exits non-zero when any record fails to sync. The step is
# allowed to continue so records that did sync still reach the PR,
# and the last step fails the job so the failure is never silent.
- name: Sync GitHub metadata
id: sync
continue-on-error: true
run: pnpm exec grove sync github --strict
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore(data): sync GitHub metadata"
title: "Sync GitHub metadata"
branch: chore/sync-github
delete-branch: true
# Sync writes only the generated cache; records stay human-owned.
add-paths: data/cache/github/**
- name: Fail when any record failed to sync
if: steps.sync.outcome == 'failure'
run: |
echo "::error::grove sync github reported failed records; see the 'Sync GitHub metadata' step log."
exit 1