adaptive-lighting/.github/workflows/markdown-code-runner.yml
2026-01-13 09:06:42 +01:00

57 lines
1.5 KiB
YAML

name: markdown-code-runner
on:
push:
branches:
- main
pull_request:
jobs:
markdown-code-runner:
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14.2"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Run markdown-code-runner
run: |
uv sync --group docs
uv pip install -e .
uv run python docs/run_markdown_code_runner.py
- name: Run update services.yaml
run: uv run python .github/update-services.py
- name: Run update strings.json
run: uv run python .github/update-strings.py
- name: Commit updated files
id: commit
run: |
git add -u .
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if git diff --quiet && git diff --staged --quiet; then
echo "No changes, skipping commit."
echo "commit_status=skipped" >> $GITHUB_ENV
else
git commit -m "Update auto-generated content"
echo "commit_status=committed" >> $GITHUB_ENV
fi
- name: Push changes
if: env.commit_status == 'committed'
run: |
git pull --rebase
git push