Fix conformance rule inconsistency, compliance matrix accuracy, citations, and structural defects #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto-sync derived artifacts | |
| # Regenerates derived files from their canonical sources whenever a PR touches | |
| # the repo, and commits the regenerated files back to the PR branch if they | |
| # differ from what was committed. | |
| # | |
| # Source -> derived mapping: | |
| # README.md -> index.md | |
| # ACKNOWLEDGEMENTS.md -> tab_acknowledgements.md | |
| # standard/<domain>/README.md (requirements) -> standard/apts_requirements.json | |
| # standard/apts_requirements_schema.json | |
| # | |
| # This workflow is the partner of `check_generated_artifacts.py`. The CI sanity | |
| # check still runs on `push: main` as a safety net; this workflow handles the | |
| # common case where a contributor forgets to regenerate a derived file and | |
| # would otherwise have their PR blocked. | |
| # | |
| # Fork PR limitation: the default GITHUB_TOKEN cannot push to a fork's | |
| # branch from a `pull_request` event, so this workflow skips fork PRs. | |
| # Contributors working from a fork must run the sync scripts locally: | |
| # | |
| # python scripts/sync_index_from_readme.py | |
| # python scripts/sync_tab_acknowledgements_from_acknowledgements.py | |
| # python scripts/export_requirements.py | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: auto-sync-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| sync: | |
| name: Regenerate and commit derived artifacts | |
| # Skip fork PRs. GITHUB_TOKEN is read-only against the fork's branch. | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Python dependencies | |
| run: | | |
| set -euo pipefail | |
| python -m pip install --upgrade pip | |
| python -m pip install "PyYAML==6.0.2" | |
| - name: Regenerate derived artifacts | |
| run: | | |
| set -euo pipefail | |
| python scripts/sync_index_from_readme.py | |
| python scripts/sync_tab_acknowledgements_from_acknowledgements.py | |
| python scripts/export_requirements.py | |
| - name: Commit and push if anything changed | |
| run: | | |
| set -euo pipefail | |
| if [[ -z "$(git status --porcelain)" ]]; then | |
| echo "Derived artifacts already in sync. Nothing to commit." | |
| exit 0 | |
| fi | |
| echo "Derived artifacts drifted. Committing regenerated files:" | |
| git status --short | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "chore(ci): auto-sync derived artifacts | |
| Regenerated by .github/workflows/auto-sync-derived-artifacts.yml | |
| from canonical sources (README.md, ACKNOWLEDGEMENTS.md, domain | |
| requirement READMEs). No human review required for this commit. | |
| [skip ci]" | |
| git push origin HEAD:${{ github.event.pull_request.head.ref }} |