Skip to content

Support GitHub Enterprise hosts for repository operations#16371

Merged
pelikhan merged 14 commits intomainfrom
copilot/review-github-url-replacement
Feb 17, 2026
Merged

Support GitHub Enterprise hosts for repository operations#16371
pelikhan merged 14 commits intomainfrom
copilot/review-github-url-replacement

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

  • Add getGitHubHost() helper to pkg/parser package
  • Update pkg/parser/remote_fetch.go to use getGitHubHost() (3 instances)
  • Update pkg/cli/download_workflow.go to use getGitHubHost() (6 instances)
  • Update pkg/cli/trial_command.go to use getGitHubHost() (3 instances)
  • Update pkg/cli/update_actions.go to use getGitHubHost() (1 instance)
  • Update pkg/cli/pr_command.go to use getGitHubHost() (1 instance)
  • Update pkg/cli/spec.go to accept any GitHub host (2 instances)
  • Update pkg/cli/git.go to accept any GitHub host (SSH & HTTPS)
  • Update safe output validation patterns to accept any GitHub host
  • Update JavaScript project URL validation to accept any GitHub host
  • Verify all tests pass
  • Build successful
  • Code formatted and validated
  • Move getGitHubHost from pkg/parser/remote_fetch.go to pkg/parser/github.go
  • Merge main branch
  • Recompile workflows
  • Add special handling for github/gh-aw repository to always use public GitHub
  • Move "https://github.com" to constants.PublicGitHubHost

Summary

Extracted the hardcoded "https://github.com" string to a constant constants.PublicGitHubHost to eliminate duplication and improve maintainability. Updated all usages in pkg/parser/github.go and pkg/cli/github.go to reference this constant.

Original prompt

Review all instance of "https://github.com/" in go or js and determine if it should be replaced by the GitHub host in the context. This is relevant for enterprise deployment outside of the GitHub domain. Use GitHub.getGithubHost


💡 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.


Changeset

  • Type: patch
  • Description: Normalize GitHub host detection and URL parsing so GitHub Enterprise deployments honor GITHUB_SERVER_URL, GITHUB_ENTERPRISE_HOST, GITHUB_HOST, and GH_HOST, allowing parser URIs and remote imports to work with enterprise URLs.

Generated by Changeset Generator


Changeset

  • Type: patch
  • Description: Normalize GitHub host detection and URL parsing so GitHub Enterprise deployments honor GITHUB_SERVER_URL, GITHUB_ENTERPRISE_HOST, GITHUB_HOST, and GH_HOST when compiling workflows and CLI commands.

Generated by Changeset Generator

@pelikhan
Copy link
Contributor

Fixes #16312

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Review and replace GitHub URLs for enterprise deployment Support GitHub Enterprise hosts for repository operations Feb 17, 2026
Copilot AI requested a review from pelikhan February 17, 2026 14:58
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 17, 2026 15:07
Copilot AI review requested due to automatic review settings February 17, 2026 15:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds GitHub Enterprise host support for repository operations by introducing GetGitHubHost() helper functions and updating hardcoded https://github.com/ references throughout the codebase to use dynamic host resolution. The implementation checks environment variables (GITHUB_SERVER_URL, GITHUB_ENTERPRISE_HOST, GITHUB_HOST, GH_HOST) in priority order and defaults to https://github.com.

Changes:

  • Added GetGitHubHost() in pkg/parser/github.go (exported) and getGitHubHost() in pkg/cli/github.go (unexported) for environment-based GitHub host resolution
  • Updated Git operations in parser and CLI packages to construct repository URLs using the resolved GitHub host
  • Modified validation patterns to accept any GitHub host while maintaining security and structural constraints

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/parser/github.go Added exported GetGitHubHost() function with environment variable priority order and URL normalization
pkg/parser/remote_fetch.go Updated 3 git ls-remote and archive operations to use GetGitHubHost() for repository URLs
pkg/cli/download_workflow.go Updated 6 git operations (release resolution, branch checks, content downloads) to use getGitHubHost()
pkg/cli/update_actions.go Updated git ls-remote for action release fetching to use getGitHubHost()
pkg/cli/trial_command.go Updated 3 workflow run URL and host repository URL constructions to use getGitHubHost()
pkg/cli/spec.go Enhanced GitHub URL parsing to support both https:// and http:// prefixes with dynamic host resolution
pkg/cli/pr_command.go Updated fork repository URL construction to use getGitHubHost()
pkg/cli/git.go Updated parseGitHubRepoSlugFromURL() to handle both HTTPS and SSH formats for any GitHub host
pkg/workflow/safe_output_validation_config.go Changed project URL validation pattern from hardcoded github.com to ^https://[^/]+/ to accept any host
actions/setup/js/update_project.cjs Updated 2 regex patterns to match project URLs from any GitHub host (parseProjectInput and parseProjectUrl)
actions/setup/js/create_project_status_update.cjs Updated regex pattern in parseProjectUrl to match project URLs from any GitHub host

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan pelikhan added the smoke label Feb 17, 2026
@github-actions
Copy link
Contributor

🧪 Smoke Project is now testing project operations...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Smoke Copilot SDK failed. Please review the logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

Smoke Project completed successfully. All project operations validated.

@github-actions
Copy link
Contributor

PR titles:

  • Bundle Dependabot npm dependency updates for /docs
  • Update all workflows to use Audits category for discussions
    GitHub MCP (2 merged PRs): ✅
    Serena MCP (activate+find_symbol): ✅
    Playwright github.com title: ✅
    File write+cat (bash): ✅
    Build gh-aw: ✅
    Overall status: PASS

🔮 The oracle has spoken through Smoke Codex for issue #16371

@pelikhan
Copy link
Contributor

@copilot merge main and recompile

@pelikhan pelikhan added the smoke label Feb 17, 2026
@github-actions
Copy link
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

🧪 Smoke Project is now testing project operations...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Smoke Copilot SDK failed. Please review the logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

🧪 Smoke Temporary ID is now testing temporary ID functionality...

@github-actions
Copy link
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.52.0
jq 1.7
yq 4.52.2
curl 8.5.0
gh 2.86.0
node 20.20.0
python3 3.12.3
go 1.24.13
java 21.0.10
dotnet 10.0.102

Result: 12/12 tools available ✅

🔧 Tool validation by Agent Container Smoke Test for issue #16371

@github-actions
Copy link
Contributor

Smoke Temporary ID completed successfully. Temporary ID validation passed.

@github-actions
Copy link
Contributor

Smoke Project completed successfully. All project operations validated.

@github-actions
Copy link
Contributor

🎭 Copilot swoops in dramatically

Greetings, @rspurgeon! Your question about dependency version harmony is delightfully meta - two sources of truth battling for supremacy like a dependency management soap opera! 🎬

The cosmic dance between gh aw compile and Renovate is indeed a fascinating tango. May the best version win! 💃🕺

📰 BREAKING: Report filed by Smoke Copilot for issue #16371

@github-actions
Copy link
Contributor

PR titles:

🔮 The oracle has spoken through Smoke Codex for issue #16371

@github-actions
Copy link
Contributor

Smoke Test: Copilot - §22110257263

PRs Tested:

Results:

  • ✅ GitHub MCP, Safe Inputs GH CLI, File Writing, Bash, Discussion Query, Build, Review
  • ❌ Playwright (timeout), Serena MCP (skipped)

Status: FAIL (10/11 passed)

@Copilot @pelikhan

📰 BREAKING: Report filed by Smoke Copilot for issue #16371

@github-actions github-actions bot removed the smoke label Feb 17, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid GitHub Enterprise support implementation. The constant extraction and repo-specific host resolution are well-designed patterns.

📰 BREAKING: Report filed by Smoke Copilot for issue #16371

@github-actions
Copy link
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

Smoke Test Results - Claude

Core Tests: ✅ 9/10 passed, ⚠️ 1 warning
PR Review Tests: ✅ 5/7 passed, ⚠️ 2 skipped

Overall Status: PARTIAL

[View full report in issue created above]

💥 [THE END] — Illustrated by Smoke Claude for issue #16371

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude for issue #16371

@pelikhan pelikhan merged commit d3b462b into main Feb 17, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/review-github-url-replacement branch February 17, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants