ci: add push protection monitoring workflow - #118
Merged
Conversation
Code Metrics Report
Details | | main (0c91c43) | #118 (4d528b3) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 68.3% | 68.3% | 0.0% |
| Files | 4 | 4 | 0 |
| Lines | 550 | 550 | 0 |
| Covered | 376 | 376 | 0 |
| Code to Test Ratio | 1:0.1 | 1:0.1 | 0.0 |
| Code | 593 | 593 | 0 |
| Test | 71 | 71 | 0 |
- | Test Execution Time | 3s | 13s | +10s |Reported by octocov |
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
Add a weekly monitoring workflow that checks whether GitHub Secret Scanning
push protection is enabled. Push protection prevents secrets from being
committed in the first place; the repository currently has secret scanning
enabled but push protection disabled.
Because enabling push protection requires a repository admin action in
GitHub settings (Settings → Code security → Secret scanning → Push
protection), this PR adds a CI gate that fails with a clear error and a
direct link to the settings page when push protection is not enabled.
Why a monitoring workflow instead of direct enablement
The GitHub API endpoint for enabling push protection requires admin scope.
A workflow using the default
GITHUB_TOKENcan only read and verify thestatus. The monitoring workflow surfaces the gap as a CI failure,
directing the maintainer to enable it via the repository settings.
Test plan
workflow_dispatchtriggers the check manually