Skip to content

Commit 6878e5f

Browse files
committed
Workflow to generate references to a folder
1 parent 92350a8 commit 6878e5f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Generate References"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
docs-generation:
11+
name: Generate references
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the repository
15+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
16+
with:
17+
fetch-depth: 0
18+
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
22+
with:
23+
python-version: 3.11.11
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5.4.1
27+
with:
28+
enable-cache: true
29+
pyproject-file: 'pyproject.toml'
30+
31+
- name: Generate references
32+
run: |
33+
uv run bin/docs generate-references
34+
35+
- name: Check for changes in references
36+
id: changes
37+
run: |
38+
if [ -n "$(git status --porcelain references/)" ]; then
39+
echo "changed=true" >> $GITHUB_OUTPUT
40+
echo "New references generated in references directory:"
41+
git status --porcelain references/
42+
else
43+
echo "changed=false" >> $GITHUB_OUTPUT
44+
echo "No new references generated in references directory"
45+
fi
46+
47+
- uses: stefanzweifel/git-auto-commit-action@v6
48+
if: steps.changes.outputs.changed == 'true'
49+
with:
50+
commit_message: "Update generated references"
51+
file_pattern: references/

0 commit comments

Comments
 (0)