From a67f48bfbeb925a827586002fc59b2324f611c5e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:45:08 +0000 Subject: [PATCH 1/3] Initial plan From 9155ae0c145da2acbf2be1e26c6177b92b6153a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:46:52 +0000 Subject: [PATCH 2/3] Create GitHub Action to run doctools.py on pull requests Co-authored-by: sei-renae <190382933+sei-renae@users.noreply.github.com> --- .github/workflows/run_doctools.yml | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/run_doctools.yml diff --git a/.github/workflows/run_doctools.yml b/.github/workflows/run_doctools.yml new file mode 100644 index 00000000..2f9dd2ac --- /dev/null +++ b/.github/workflows/run_doctools.yml @@ -0,0 +1,49 @@ +name: "Run doctools on PR" + +on: + pull_request: + paths: + - 'src/ssvc/**' + - .github/workflows/run_doctools.yml + +permissions: + contents: write + +jobs: + run-doctools: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Set up Python 3.12 + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip uv + uv sync --dev --frozen + + - name: Run doctools + run: | + # Remove stale decision point files so doctools generates a clean set + rm -rf data/json/decision_points + export PYTHONPATH=$(pwd)/src + uv run python -m ssvc.doctools --overwrite --datadir ./data + + - name: Commit changes to data/ + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add data/ + if git diff --cached --quiet; then + echo "No changes to commit" + else + git commit -m "chore: regenerate data files via doctools [skip ci]" + git push + fi From 691a6b15492971adfb052c58b86054388024f8a2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 18:20:02 +0000 Subject: [PATCH 3/3] Fix doctools workflow: handle fork PRs and replace [skip ci] with actor check Co-authored-by: ahouseholder <2594236+ahouseholder@users.noreply.github.com> --- .github/workflows/run_doctools.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_doctools.yml b/.github/workflows/run_doctools.yml index 2f9dd2ac..a11e0855 100644 --- a/.github/workflows/run_doctools.yml +++ b/.github/workflows/run_doctools.yml @@ -11,6 +11,8 @@ permissions: jobs: run-doctools: + # Skip when the auto-commit from this workflow triggers a re-run + if: github.actor != 'github-actions[bot]' runs-on: ubuntu-latest steps: @@ -36,7 +38,20 @@ jobs: export PYTHONPATH=$(pwd)/src uv run python -m ssvc.doctools --overwrite --datadir ./data + - name: Fail if fork PR has uncommitted data/ changes + if: github.event.pull_request.head.repo.full_name != github.repository + run: | + git add data/ + if git diff --cached --quiet; then + echo "No data/ changes detected." + else + echo "::error::This PR is from a fork and data/ files need to be regenerated." + echo "::error::Please run 'make regenerate_json' locally and push the resulting data/ changes to your PR branch." + exit 1 + fi + - name: Commit changes to data/ + if: github.event.pull_request.head.repo.full_name == github.repository run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" @@ -44,6 +59,6 @@ jobs: if git diff --cached --quiet; then echo "No changes to commit" else - git commit -m "chore: regenerate data files via doctools [skip ci]" + git commit -m "chore: regenerate data files via doctools" git push fi