Install Git pre-commit hooks to enforce checks in Copilot agent environment#153
Merged
josecelano merged 2 commits intomainfrom Nov 6, 2025
Merged
Conversation
… integration Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Install Git pre-commit hooks for Copilot agent
Install Git pre-commit hooks to enforce checks in Copilot agent environment
Nov 6, 2025
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.
Instructing the Copilot agent via
.github/copilot-instructions.mdto run pre-commit checks was unreliable - the agent would sometimes forget or skip checks. This enforces pre-commit checks mechanistically via Git hooks instead of instructionally.Changes
scripts/install-git-hooks.sh: Creates symlink from.git/hooks/pre-commit→scripts/pre-commit.sh.gitexists, source script exists).github/workflows/copilot-setup-steps.yml: Added hook installation step after dependency setupHow it works
Symlink approach ensures hook always uses latest version of
scripts/pre-commit.shwithout reinstallation.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
10.228.208.161ssh -i /home/REDACTED/work/torrust-tracker-deployer/torrust-tracker-deployer/fixtures/testing_rsa -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o UserKnownHostsFile=/dev/null torrust@10.228.208.161 echo 'SSH connected'(packet block)ssh -i /home/REDACTED/work/torrust-tracker-deployer/torrust-tracker-deployer/fixtures/testing_rsa -p 22 -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 -o StrictHostKeyChecking=no torrust@10.228.208.161 echo 'SSH connected'(packet block)ssh -i /home/REDACTED/work/torrust-tracker-deployer/torrust-tracker-deployer/fixtures/testing_rsa -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 torrust@10.228.208.161 echo 'SSH connected'(packet block)192.0.2.1ssh -i /nonexistent/key -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 testuser@192.0.2.1 echo 'SSH connected'(packet block)ssh -i /nonexistent/key -p 22 -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null testuser@192.0.2.1 echo 'SSH connected'(packet block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.