Skip to content

Compiler does not emit GITHUB_HOST in MCP server env for GHES targets #20811

@jaroslawgajewski

Description

@jaroslawgajewski

Test result (v0.58.0): Fresh compilation of any workflow with env: GH_HOST in frontmatter produces a lock file with "GITHUB_PERSONAL_ACCESS_TOKEN" in the MCP server JSON env but no "GITHUB_HOST" entry. The MCP server env contains 0 occurrences of GITHUB_HOST. Every lock file requires post-compilation injection.

Problem: The compiled lock file's MCP server JSON config does not include a GITHUB_HOST environment variable. The GitHub MCP Server defaults to api.github.com, so all API calls fail on GHES with 401/404. Users must manually inject "GITHUB_HOST":"https://<ghes-host>" into the MCP server env block after every compilation.

Expected behavior: When env.GH_HOST is set in the workflow .md frontmatter (or a GHES API URL is otherwise detectable), the compiler should emit "GITHUB_HOST":"https://<ghes-host>" in the MCP server env block automatically. The value must include the https:// scheme — the MCP Server rejects bare hostnames since v0.30.3.

Suggested fix: Add a compiler pass that reads the workflow-level GH_HOST env var and, when set to a non-github.com value, injects GITHUB_HOST with the full URL (including scheme) into the MCP server container env.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions