-
Notifications
You must be signed in to change notification settings - Fork 0
✨ Add validate-pr-secret workflow with gitleaks-action #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This must also be in a stub
|
Co-authored-by: tomgrv <1809566+tomgrv@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds automated secret scanning to pull requests using the gitleaks-action to prevent accidentally committed sensitive information like API keys, passwords, and tokens from reaching the main branch.
- Adds GitHub workflow for automated secret detection on all PR events
- Provides reusable template in githooks feature stubs for downstream projects
- Integrates with existing PR validation workflow patterns in the repository
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/validate-pr-secret.yml |
Main workflow that runs gitleaks secret scanning on all pull request events |
src/githooks/stubs/.github/workflows/validate-pr-secret.yml |
Template workflow for projects using the githooks devcontainer feature |
Description
This PR adds automated secret scanning to pull requests using the gitleaks-action. This ensures that sensitive information like API keys, passwords, and tokens are not accidentally committed to the repository.
Changes
Added
.github/workflows/validate-pr-secret.ymlworkflow that:gitleaks/gitleaks-action@v2to scan for secretsfetch-depth: 0for comprehensive detectionAdded
src/githooks/stubs/.github/workflows/validate-pr-secret.ymlstub template:Benefits
validate-pr-format.yml)Example
When a pull request is opened or updated, the workflow will automatically scan for common secret patterns including:
If secrets are detected, the workflow will fail and provide details about the findings, allowing developers to address the issue before merging.
Fixes #33
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.