-
Notifications
You must be signed in to change notification settings - Fork 113
Create ghas-push-protection-resolve-block.prompt.md #28
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
base: main
Are you sure you want to change the base?
Conversation
A prompt file for Copilot agent mode to assist with automating the removal of secrets after a GitHub Advanced Security push protection blocked push.
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 introduces a new agent-mode prompt file to guide developers through resolving push blocks triggered by GitHub Advanced Security secret scanning.
- Adds
ghas-push-protection-resolve-block.prompt.md
with automated analysis, strategy selection, and execution steps. - Defines error pattern recognition, resolution strategies (amend, rebase, multi-commit), and secret removal best practices.
- Covers false-positive handling, merge-conflict guidance, and post-resolution verification.
Comments suppressed due to low confidence (4)
prompts/ghas-push-protection-resolve-block.prompt.md:4
- [nitpick] Rephrase the frontmatter description for clarity, e.g.: "Help developers resolve pushes blocked by GitHub Advanced Security due to detected secrets."
description: "Help developers resolve GitHub Advanced Security push protection blocked pushes containing secrets"
prompts/ghas-push-protection-resolve-block.prompt.md:19
- [nitpick] Convert the raw URL into a markdown link with descriptive text or split it across lines to improve readability, e.g.,
[Resolving a blocked push](<URL>)
.
- Resolving a blocked push: https://docs.github.com/en/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line#resolving-a-blocked-push
prompts/ghas-push-protection-resolve-block.prompt.md:24
- Add a language identifier (e.g., ```text) to this code fence for error pattern recognition to enable proper syntax highlighting.
**prompts/ghas-push-protection-resolve-block.prompt.md:49**
* Include a sample command sequence or script snippet under the "Multiple Commits" strategy to match the level of detail provided for the other strategies.
Multiple Commits
</details>
tools: ["changes", "codebase", "editFiles", "problems", "terminal"] | ||
description: "Help developers resolve GitHub Advanced Security push protection blocked pushes containing secrets" | ||
--- | ||
|
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.
You probably want to add a level one header in here so that when the update script is run it will generate the correct name.
@@ -63,6 +63,9 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi | |||
- [My Pull Requests](prompts/my-pull-requests.prompt.md) | |||
- [C# Documentation Best Practices](prompts/csharp-docs.prompt.md) - Ensure that C# types are documented with XML comments and follow best practices for documentation. | |||
|
|||
### Security | |||
- [Resolve a GitHub Advanced Security Push Protection blocked push] - Automate removing secrets from commit history |
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.
The description doesn't match the one in the prompt file. Ensure this is generated using the update-readme.js
script
This pull request introduces a new prompt file,
ghas-push-protection-resolve-block.prompt.md
, designed to assist developers in resolving blocked pushes caused by GitHub Advanced Security push protection. The prompt provides automated guidance for Copilot agent mode to help analyze errors, select resolution strategies, and ensure secure practices for handling secrets in code, all automatically with minimal developer intervention.This pull request also updates the repo's README to include a link to this new prompt file.
I tested it in the following scenarios:
And the prompt was successful in all of them.