mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Bas Nijholt <bas@nijho.lt>
48 lines
1.5 KiB
YAML
48 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@v7
|
|
with:
|
|
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
|
ref: ${{ github.head_ref || github.ref }}
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.14.7"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v10.0.1
|
|
|
|
- name: Update generated content
|
|
run: ./scripts/update-generated-content
|
|
|
|
- name: Check for changes
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
|
echo "::error::Auto-generated files are not up to date. Please run './scripts/update-generated-content' locally and push the changes."
|
|
exit 1
|
|
else
|
|
echo "Changes detected, committing and pushing..."
|
|
git add -u .
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
git commit -m "Update auto-generated content"
|
|
git pull --rebase
|
|
git push
|
|
fi
|
|
else
|
|
echo "No changes detected."
|
|
fi
|