-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.48 KB
/
regenerate-docs.yml
File metadata and controls
53 lines (49 loc) · 1.48 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
name: Regenerate docs indexes
on:
push:
branches: [main]
paths:
- "experiments/**/README.md"
- "experiments/**/data/summary.csv"
- "scripts/pm/itemize_experiments.py"
- "scripts/pm/plot_bench.py"
issues:
types: [opened, closed, reopened, labeled, unlabeled, edited]
workflow_dispatch:
permissions:
contents: write
issues: read
concurrency:
group: regenerate-docs
cancel-in-progress: false
jobs:
regenerate:
# Avoid commit loops: skip when the last pusher was the bot.
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install deps
run: pip install pyyaml
- name: Regenerate
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/pm/itemize_experiments.py
python scripts/pm/plot_bench.py
- name: Commit if changed
run: |
if git diff --quiet docs/experiments/index.md docs/benchmarks.md; then
echo "No changes."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/experiments/index.md docs/benchmarks.md
git commit -m "chore: regenerate docs indexes"
git push