On branch edburns/spotless-agentic-workflow-42#43
Merged
edburns merged 2 commits intogithub:mainfrom Mar 31, 2026
Merged
Conversation
modified: .github/copilot-instructions.md - Added a new "Pre-commit Hooks and Formatting (Coding Agent)" section that: - Explains the hook is automatically enabled via copilot-setup-steps.yml - Gives explicit 3-step recovery instructions: mvn spotless:apply → git add -u → retry commit - Recommends running mvn spotless:apply proactively before committing Now when the Copilot coding agent starts a session, the setup steps will enable the pre-commit hook, and if a commit is rejected by Spotless formatting checks, the agent has clear instructions to fix and retry. modified: .github/workflows/copilot-setup-steps.yml - Added a new step "Enable pre-commit hooks" that runs git config core.hooksPath .githooks before the verification step - Updated the verification step to also print the configured hooks path for confirmation Signed-off-by: Ed Burns <edburns@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Copilot coding-agent setup to proactively enable the repository’s pre-commit hook and documents a clear recovery flow when Spotless formatting checks block a commit, reducing agentic workflow failures caused by formatting.
Changes:
- Enable Git hooks in the Copilot setup workflow by setting
core.hooksPathto.githooks. - Extend the setup workflow verification output to print the configured hooks path.
- Add Copilot agent guidance for handling Spotless pre-commit failures (apply → re-stage → retry).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/copilot-setup-steps.yml | Configures the agent environment to enable pre-commit hooks and confirms hook path during verification. |
| .github/copilot-instructions.md | Documents how the coding agent should recover from Spotless pre-commit failures and recommends running Spotless proactively. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
modified: .github/copilot-instructions.md
Now when the Copilot coding agent starts a session, the setup steps will enable the pre-commit hook, and if a commit is rejected by Spotless formatting checks, the agent has clear instructions to fix and retry.
modified: .github/workflows/copilot-setup-steps.yml
Resolves #42