Skip to content

feat(ci): skip codeql and scorecard scans on private repos - #1050

Merged
c-vigo merged 2 commits into
devfrom
feature/1039-private-repo-workflow-guards
Jul 14, 2026
Merged

c-vigo merged 2 commits into
devfrom
feature/1039-private-repo-workflow-guards

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #1039 via the issue's recommended Option 1 — a runtime guard, so the scaffold stays uniform and a repo later flipped public starts scanning automatically with no re-scaffold.

  • Job-level if: ${{ !github.event.repository.private }} on codeql.yml's analyze and scorecard.yml's analysis jobs. Private repos get skipped (neutral) runs instead of two permanently red workflows (CodeQL needs GHAS — unavailable on Free-plan private repos; Scorecard is public-only).
  • Both files are manifest-synced: the guard lands in the root SSoT copies (a no-op for the public devkit) and the scaffold copies are regenerated byte-identical.
  • Trigger-payload correctness researched explicitly: github.event.repository.private is populated on pull_request, push, and — since GitHub's 2022-09-27 change adding repository info to scheduled-run payloads — schedule, covering every trigger both workflows declare. Reasoning recorded in each workflow header.
  • Documented in docs/MIGRATION.md at the existing codeql/scorecard description.

Unblocks the second cad2gdml Phase-0 prerequisite (#1040); the last one (#1038) merged in #1048.

TDD: new tests/test_workflow_private_repo_guard.py (YAML-parses all 4 copies, asserts the job guard) — RED 4 failed → GREEN 4 passed.

Test evidence

  • uv run pytest tests/test_workflow_private_repo_guard.py → 4 passed
  • actionlint clean on all 4 workflow files
  • prek run --all-files → green (re-verified independently before push)

Closes #1039
Refs: #1040

@c-vigo
c-vigo merged commit f76c7d4 into dev Jul 14, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/1039-private-repo-workflow-guards branch July 14, 2026 09:51
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.

1 participant