Repository navigation
feat(ci): skip codeql and scorecard scans on private repos - #1050
Merged
Merged
Conversation
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
if: ${{ !github.event.repository.private }}oncodeql.yml'sanalyzeandscorecard.yml'sanalysisjobs. 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).github.event.repository.privateis populated onpull_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.docs/MIGRATION.mdat 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 passedactionlintclean on all 4 workflow filesprek run --all-files→ green (re-verified independently before push)Closes #1039
Refs: #1040