Remove GH_TOKEN from agentic-workflows MCP server config#14044
Remove GH_TOKEN from agentic-workflows MCP server config#14044
Conversation
…ironment Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove GH_TOKEN frombtbe config |
Add GH_TOKEN to MCP gateway environment variables to fix "undefined environment variable referenced: GH_TOKEN" error in workflows using agentic-workflows MCP server. Changes: - Add GH_TOKEN to mcp_environment.go with token cascading (GH_AW_GITHUB_MCP_SERVER_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN) - Add GH_TOKEN to standardEnvVars list in mcp_setup_generator.go to prevent duplicate addition - Add GH_TOKEN to Docker container environment variables list with -e GH_TOKEN flag - Rebuild binary and recompile all workflows to apply the fix Fixes: Daily Firewall Logs Collector and Reporter workflow failure (run 21738341195) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Update GH_TOKEN to use getEffectiveGitHubToken() which respects custom token and top-level github-token from frontmatter, ensuring proper token cascading and fixing TestAgenticWorkflowsInstallStepWithCustomToken test failure.
Changes:
- Use getEffectiveGitHubToken("", workflowData.GitHubToken) to get the effective token for GH_TOKEN
- This ensures custom tokens are respected when specified in workflow config
- Maintains backward compatibility with default token fallback
All tests pass, including TestAgenticWorkflowsInstallStepWithCustomToken.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Remove GH_TOKEN environment variable reference from agentic-workflows MCP server configuration. The MCP server's ExecGH() helper automatically sets GH_TOKEN from GITHUB_TOKEN when needed, so explicit GH_TOKEN reference is unnecessary. This is a simpler fix than adding GH_TOKEN to the environment passing infrastructure - just remove the redundant reference from the config. Addresses feedback from @pelikhan to remove GH_TOKEN from the config. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
❌ Changeset Generator failed. Please review the logs for details. |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
Agent Container Tool CheckSmoke test completed for PR #14044
Result: 10/12 tools available Issues FoundJava & .NET Execution Problems:
This appears to be a container configuration issue rather than missing installations. All other development tools are working correctly.
|
Smoke Test ResultsPRs Tested:
Results:
Status:
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
There was a problem hiding this comment.
Pull request overview
This PR removes the redundant GH_TOKEN environment variable reference from the agentic-workflows MCP server configuration, resolving workflow failures caused by undefined environment variables. The fix leverages the existing automatic fallback mechanism in the ExecGH() helper function that sets GH_TOKEN from GITHUB_TOKEN when needed.
Changes:
- Removed redundant
GH_TOKENenvironment variable from agentic-workflows MCP server config - Added clarifying comment explaining the automatic GH_TOKEN fallback behavior
- Recompiled all 145 workflow lock files to reflect the configuration change
Reviewed changes
Copilot reviewed 146 out of 146 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflow/mcp_config_builtin.go | Removed GH_TOKEN from environment variables array (line 169) and TOML env_vars array (line 333), added explanatory comment about automatic fallback |
| .github/workflows/*.lock.yml | All 145 workflow lock files recompiled to reflect the configuration change, including addition of MCP_GATEWAY_PAYLOAD_DIR setup and payloadDir in gateway config |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The "Daily Firewall Logs Collector and Reporter" workflow was failing with "undefined environment variable referenced: GH_TOKEN" because the agentic-workflows MCP server configuration referenced
${GH_TOKEN}, but this variable wasn't being passed to the MCP gateway container.Changes
Removed
GH_TOKENfrom agentic-workflows MCP config (mcp_config_builtin.go):GH_TOKENenvironment variable reference from JSON config (line 169)GH_TOKENfrom TOML config env_vars array (line 333)Recompiled all workflows:
.lock.ymlfiles updated to reflect the configuration changeTechnical Context
The agentic-workflows MCP server's
ExecGH()helper function (inpkg/workflow/github_cli.go) automatically handles theGH_TOKENfallback:This means the MCP server only needs
GITHUB_TOKENin its configuration - it will automatically createGH_TOKENfromGITHUB_TOKENwhen running gh CLI commands.Before:
After:
This is a minimal fix that removes the redundant environment variable reference, eliminating the "undefined environment variable" error without adding unnecessary complexity to the environment passing infrastructure.
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.