-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (59 loc) · 2.16 KB
/
refresh-docs-snapshot.yml
File metadata and controls
69 lines (59 loc) · 2.16 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: 05-refresh-docs-snapshot
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
refresh:
name: 01-refresh-docs-snapshot
runs-on: ubuntu-latest
steps:
- name: 01-checkout
uses: actions/checkout@v4
- name: 02-setup-tooling
uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd
with:
install: true
cache: true
experimental: true
env:
# Required for aqua-backed tool installs to avoid GitHub API rate limits in CI.
GITHUB_TOKEN: ${{ github.token }}
- name: 03-refresh-docs-parquet
run: |
mise run setup
mkdir -p .memory
DOCS_SUMMARY_PATH=.memory/docs-refresh-summary.json bun run src/docs/fetch-cli.ts
- name: 04-build-pr-body
run: |
node <<'NODE'
const fs = require('fs');
const summaryPath = '.memory/docs-refresh-summary.json';
const summary = JSON.parse(fs.readFileSync(summaryPath, 'utf8'));
const sha = process.env.GITHUB_SHA || 'unknown';
const shortSha = sha.slice(0, 12);
const generatedAt = summary.generatedAt || new Date().toISOString();
const body = [
'## Docs Snapshot Refresh',
'',
`- Source commit: \`${shortSha}\``,
`- Generated at: \`${generatedAt}\``,
`- Total pages discovered: ${summary.totalPages}`,
`- Pages fetched: ${summary.fetchedPages}`,
`- Pages failed: ${summary.failedPages}`,
'',
'This PR was generated by the manual `Refresh Docs Snapshot` workflow.',
].join('\n');
fs.writeFileSync('.memory/docs-refresh-pr-body.md', `${body}\n`, 'utf8');
NODE
- name: 05-create-pull-request
uses: peter-evans/create-pull-request@v7
with:
branch: chore/refresh-docs-snapshot
title: 'chore(data): refresh docs snapshot'
commit-message: 'chore(data): refresh docs snapshot'
body-path: .memory/docs-refresh-pr-body.md
delete-branch: true
add-paths: |
data/docs.parquet