Copilot: Enforce gh CLI usage for issue and PR operations#337
Merged
florian-h05 merged 1 commit intoopenhab:mainfrom Apr 2, 2026
Merged
Copilot: Enforce gh CLI usage for issue and PR operations#337florian-h05 merged 1 commit intoopenhab:mainfrom
florian-h05 merged 1 commit intoopenhab:mainfrom
Conversation
Add workspace-level Copilot customizations to prevent the agent from opening GitHub issue and pull request URLs in a browser, and redirect it to use the `gh` CLI instead. - `.github/copilot-instructions.md`: workspace instructions listing preferred `gh issue` and `gh pr` commands, with an explicit rule never to open a browser page for GitHub issues or PRs - `.github/hooks/block-github-browser.json`: registers a `PreToolUse` hook pointing to the blocking script - `.github/hooks/block-github-browser.sh`: inspects every tool call before execution; denies `open_browser_page` and `navigate_page` calls whose URL matches a GitHub issue or PR pattern, returning a `permissionDecision: deny` with a hint to use `gh` instead Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
Contributor
Author
|
@florian-h05 ➡ ready for your review |
florian-h05
approved these changes
Apr 2, 2026
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
Adds workspace-level Copilot customizations to prevent the agent from opening GitHub issue and pull request URLs in a browser, and redirect it to use the
ghCLI instead.Changes
.github/copilot-instructions.md: workspace instructions listing preferredgh issueandgh prcommands, with an explicit rule never to open a browser page for GitHub issues or PRs.github/hooks/block-github-browser.json: registers aPreToolUsehook pointing to the blocking script.github/hooks/block-github-browser.sh: inspects every tool call before execution; deniesopen_browser_pageandnavigate_pagecalls whose URL matches a GitHub issue or PR pattern, returning apermissionDecision: denywith a hint to useghinstead