Skip to content

Add GitHub Action to run doctools.py on pull requests and commit data changes#1070

Merged
ahouseholder merged 4 commits intomainfrom
copilot/add-github-action-doctools
Mar 6, 2026
Merged

Add GitHub Action to run doctools.py on pull requests and commit data changes#1070
ahouseholder merged 4 commits intomainfrom
copilot/add-github-action-doctools

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Independent contributors rely on local git hooks to run src/ssvc/doctools.py when src/ssvc/* changes. This adds a CI enforcement step so PRs always regenerate and commit updated data/ files before merging.

Changes

  • .github/workflows/run_doctools.yml — new workflow that:
    • Triggers on PRs touching src/ssvc/**
    • Installs deps via uv, clears stale data/json/decision_points/, then runs python -m ssvc.doctools --overwrite --datadir ./data
    • Non-fork PRs: auto-commits any resulting data/ changes back to the PR branch; no-ops if nothing changed
    • Fork PRs: verifies no data/ regeneration is needed; fails with a clear error message instructing the contributor to run make regenerate_json locally and push the results (since GITHUB_TOKEN cannot push back to a fork)
    • Skips the job entirely when triggered by github-actions[bot] (via if: github.actor != 'github-actions[bot]') to prevent recursion while still allowing all other CI checks to run on the auto-committed data/ update
Original prompt

This section details on the original issue you should resolve

<issue_title>Create GitHub action to run doctools.py on pull requests</issue_title>
<issue_description>Independent contributors have local git hooks to run src/ssvc/doctools.py if code is changed in src/ssvc/*.

We want a GitHub action to run doctools.py on pull requests before merging, and then commit changes made in data/</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: sei-renae <190382933+sei-renae@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub action to run doctools.py on pull requests Add GitHub Action to run doctools.py on pull requests and commit data changes Feb 27, 2026
@sei-renae sei-renae marked this pull request as ready for review March 2, 2026 15:12
Copilot AI review requested due to automatic review settings March 2, 2026 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CI enforcement to run ssvc.doctools on pull requests that modify src/ssvc/**, with the intent of ensuring regenerated data/ artifacts are committed before merge.

Changes:

  • Introduces a new GitHub Actions workflow to run python -m ssvc.doctools --overwrite --datadir ./data on relevant PRs.
  • Removes existing data/json/decision_points prior to regeneration to avoid stale outputs.
  • Attempts to auto-commit and push any resulting data/ changes back to the PR branch.

@ahouseholder
Copy link
Contributor

@copilot apply changes based on the comments in this thread

…or check

Co-authored-by: ahouseholder <2594236+ahouseholder@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 6, 2026

@copilot apply changes based on the comments in this thread

Applied both reviewer suggestions in commit 691a6b1:

  1. Fork handling — Added a Fail if fork PR has uncommitted data/ changes step that runs only when github.event.pull_request.head.repo.full_name != github.repository. It errors out with a clear message telling the contributor to run make regenerate_json locally and push the result. The commit/push step is conditionally skipped for fork PRs.

  2. Replaced [skip ci] — Added if: github.actor != 'github-actions[bot]' at the job level. When the auto-commit triggers a new workflow run, the job is skipped entirely, so all other CI checks still execute against the updated data/ commit.

@ahouseholder ahouseholder merged commit 10c2193 into main Mar 6, 2026
3 checks passed
@ahouseholder ahouseholder deleted the copilot/add-github-action-doctools branch March 6, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create GitHub action to run doctools.py on pull requests

4 participants