Skip to content

Commit 74c3642

Browse files
authored
fix: Copy gh-aw binary to /opt/gh-aw for agentic-workflows MCP server containerization (#10494)
1 parent 3fc1435 commit 74c3642

10 files changed

Lines changed: 103 additions & 0 deletions

.github/workflows/agent-performance-analyzer.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/agent-persona-explorer.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-observability-report.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/example-workflow-analyzer.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/metrics-collector.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/python-data-charts.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/security-review.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/smoke-copilot.lock.yml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/workflow/agentic_workflow_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ func TestAgenticWorkflowsInstallStepIncludesGHToken(t *testing.T) {
164164
"install step should include command to install gh-aw extension")
165165
assert.Contains(t, result, "gh aw --version",
166166
"install step should include command to verify gh-aw installation")
167+
168+
// Verify the binary copy command is present for MCP server containerization
169+
assert.Contains(t, result, "cp \"$GH_AW_BIN\" /opt/gh-aw/gh-aw",
170+
"install step should copy gh-aw binary to /opt/gh-aw for MCP server containerization")
167171
}
168172

169173
func TestAgenticWorkflowsInstallStepWithCustomToken(t *testing.T) {

pkg/workflow/mcp_servers.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ func (c *Compiler) generateMCPSetup(yaml *strings.Builder, tools map[string]any,
248248
yaml.WriteString(" gh extension install githubnext/gh-aw\n")
249249
yaml.WriteString(" fi\n")
250250
yaml.WriteString(" gh aw --version\n")
251+
yaml.WriteString(" # Copy the gh-aw binary to /opt/gh-aw for MCP server containerization\n")
252+
yaml.WriteString(" mkdir -p /opt/gh-aw\n")
253+
yaml.WriteString(" GH_AW_BIN=$(which gh-aw 2>/dev/null || find ~/.local/share/gh/extensions/gh-aw -name 'gh-aw' -type f 2>/dev/null | head -1)\n")
254+
yaml.WriteString(" if [ -n \"$GH_AW_BIN\" ] && [ -f \"$GH_AW_BIN\" ]; then\n")
255+
yaml.WriteString(" cp \"$GH_AW_BIN\" /opt/gh-aw/gh-aw\n")
256+
yaml.WriteString(" chmod +x /opt/gh-aw/gh-aw\n")
257+
yaml.WriteString(" echo \"Copied gh-aw binary to /opt/gh-aw/gh-aw\"\n")
258+
yaml.WriteString(" else\n")
259+
yaml.WriteString(" echo \"::error::Failed to find gh-aw binary for MCP server\"\n")
260+
yaml.WriteString(" exit 1\n")
261+
yaml.WriteString(" fi\n")
251262
}
252263

253264
// Write safe-outputs MCP server if enabled

0 commit comments

Comments
 (0)