-
Notifications
You must be signed in to change notification settings - Fork 141
Add support for GITHUB_ACTOR and GITHUB_REPOSITORY environment variables with --validate-actor flag in mcp-server command #15084
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
|
@copilot update the minimum required role to write instead of maintainer. |
- Add --actor flag to NewMCPServerCommand with support for GITHUB_ACTOR env var - Implement conditional tool mounting for logs and audit tools - Update workflow compilation to pass --actor flag in release mode - Add GITHUB_ACTOR to environment variables in MCP config - Update both JSON (Copilot/Claude) and TOML (Codex) renderers - Update Dockerfile documentation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…dit tools Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated the minimum required role from maintainer to write for logs and audit tools in commit ce674cf. Changes include:
|
🔍 PR Triage ResultsCategory: feature | Risk: medium | Priority: 38/100 Scores Breakdown
📋 Recommended Action: deferExplanation: This WIP PR adds access control functionality via --actor flag. The large changeset (27 files) includes workflow lock file regeneration. Should wait for completion and thorough CI validation given the scope. Next Steps:
Triaged by PR Triage Agent on 2026-02-12
|
|
@copilot remove --actor flag support, only support env var GITHUB_ACTOR |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Removed the Changes:
|
|
- Add --validate-actor flag to mcp-server command - When enabled, requires GITHUB_ACTOR to mount logs and audit tools - When disabled (default), mounts all tools regardless of actor - Update Dockerfile CMD to include --validate-actor flag - Update help text and examples to document the new flag Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…flows MCP server - Add GITHUB_REPOSITORY to envVars in renderAgenticWorkflowsMCPConfigWithOptions (JSON) - Add GITHUB_REPOSITORY to env_vars in renderAgenticWorkflowsMCPConfigTOML (TOML, mcp_config_builtin.go) - Add GITHUB_REPOSITORY to env_vars in renderAgenticWorkflowsTOML (TOML, mcp_renderer.go) - Update --validate-actor flag in release mode entrypointArgs (both renderers) - Update dev mode comments to reflect --validate-actor in Dockerfile CMD - Recompile all 148 workflows with updated environment variables Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Changeset Generator completed successfully! |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🧪 Smoke Project is now testing project operations... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
Agent Container Tool Check
Result: 12/12 tools available ✅ All required development tools are accessible in the agent container environment.
|
|
✅ Smoke Project completed successfully. All project operations validated. |
Smoke Test Results: ✅ PASSPR Titles Tested:
Test Results: 8/9 passed
Overall: PASS cc: @pelikhan
|
|
Merged PRs: chore: add account summary table (#15176); chore: enhance bot report summary (#15175)
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Add documentation for the new --validate-actor flag and environment variable support (GITHUB_ACTOR, GITHUB_REPOSITORY) added in PR #15084. - Document actor validation behavior and requirements - Explain permission checking via GitHub API with 1-hour caching - Add error message examples for troubleshooting - Update both CLI reference and MCP server guide Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implementation Plan: Add GITHUB_ACTOR and GITHUB_REPOSITORY Environment Variable Support to mcp-server Command
Overview
Add support for the
GITHUB_ACTORandGITHUB_REPOSITORYenvironment variables to themcp-servercommand to determine the role of the current actor (admin, maintain, write) for access control. The actor information is required for audit and logs functionality to work properly. The--validate-actorflag enforces actor validation when enabled.Changes Made
/repos/{owner}/{repo}/collaborators/{username}/permissionendpointGITHUB_REPOSITORYenv var first (fast path)gh repo viewif env var not setcheckActorPermissionfunction that validates permissions when restricted tools are called--validate-actorflag to enforce validation in containerized environmentsCaching Strategy
{actor}:{repository}gh repo viewCLI callsGET /repos/{owner}/{repo}/collaborators/{username}/permissionBehavior
Error Messages
When GITHUB_ACTOR is not set:
{ "error": "GITHUB_ACTOR environment variable not set", "tool": "logs", "reason": "This tool requires at least write access to the repository. Set GITHUB_ACTOR environment variable to enable access." }When actor has insufficient permissions:
{ "error": "insufficient repository permissions", "actor": "username", "repository": "owner/repo", "role": "read", "required": "write, maintain, or admin", "reason": "Actor username has read access to owner/repo. This tool requires at least write access." }Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset