Add GHES support via -g and -p flags#3
Conversation
Add two new flags to support pointing ARC at a GitHub Enterprise Server instance: -g <config-url> Full ARC githubConfigUrl for GHES -p <token> PAT for authenticating ARC against GHES When neither flag is provided, behavior is unchanged — ARC targets the dotcom repo created by the extension. When -g is used, -p is required (validated at startup). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds optional GitHub Enterprise Server (GHES) targeting for the Actions Runner Controller (ARC) configuration while keeping the extension’s existing “create dotcom repo + Codespace + install ARC” flow as the default.
Changes:
- Added
-g <config-url>and-p <token>flags to parameterize ARC’sgithubConfigUrland auth token. - Added validation requiring
-pwhen-gis specified. - Documented GHES usage and consolidated options in the README.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents GHES targeting and updates the options table. |
gh-mini-arc |
Adds CLI flags + validation and uses resolved token/config URL when setting Codespaces secrets. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Enterprise Server (GHES) support to the gh mini-arc extension by allowing users to provide an ARC githubConfigUrl and authentication token, while still creating/running the Codespace on GitHub.com.
Changes:
- Added
-g(GHES config URL) and-p(PAT) flags togh-mini-arc, plus validation and parameterized secret values. - Updated README with a GHES usage section and a consolidated options table.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents GHES usage and adds -g/-p to the options table. |
gh-mini-arc |
Parses -g/-p, validates pairing, and sets ARC token/config URL secrets based on GHES inputs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
gh-mini-arc:58
- The
-g/-ppairing check is usingGHES_PAT/GHES_CONFIG_URLdirectly, so exportingGHES_PAT(as suggested in the README) and then runninggh mini-arcwithout-gwill fail with the "must be used together" error. To keep default behavior unchanged, consider validating only CLI-provided flags (or gating the check behind-g), and ignoreGHES_PATunless GHES mode is enabled.
# -g and -p must be used together
if [ -n "${GHES_CONFIG_URL}" ] && [ -z "${GHES_PAT}" ] || [ -z "${GHES_CONFIG_URL}" ] && [ -n "${GHES_PAT}" ]; then
echo "Error: -g <config-url> and -p <token> must be used together" >&2
exit 1
fi
gh-mini-arc:76
ARC_TOKEN/ARC_CONFIG_URLcurrently preferGHES_PAT/GHES_CONFIG_URLeven when-gisn’t provided. This means simply having those env vars set changes the "no flags" path (and can make the script use a GHES PAT against dotcom). If the intent is "GHES only when -g is specified", gate the env var fallback behindGHES_CONFIG_URL(or another explicit GHES-mode flag) so the default path always usesgh auth token+ the dotcom repo URL.
# Resolve the ARC token and config URL — use GHES values if provided, otherwise default to dotcom
ARC_TOKEN="${GHES_PAT:-$(gh auth token)}"
ARC_CONFIG_URL="${GHES_CONFIG_URL:-https://github.com/${REPO_OWNER}/${REPO_NAME}}"
gh secret set FAST_ARC_TOKEN -a codespaces --repo ${REPO_OWNER}/${REPO_NAME} --body "${ARC_TOKEN}"
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Require -g and -p together (reject either flag without the other) - Document GHES_PAT env var as preferred alternative to -p flag - Add prerequisite note that gh must be authenticated to github.com Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds GitHub Enterprise Server (GHES) targeting support to the gh mini-arc extension by allowing the ARC runner registration configuration (token + githubConfigUrl) to be overridden while still creating/running the Codespace on GitHub.com.
Changes:
- Added
-g(GHESgithubConfigUrl) and-p(GHES PAT) flags with basic validation ingh-mini-arc. - Parameterized the ARC token/config URL secrets to use GHES values when provided, otherwise default to dotcom behavior.
- Updated README with GHES usage instructions and an options table including the new flags.
Show a summary per file
| File | Description |
|---|---|
gh-mini-arc |
Adds -g/-p flags, validates flag combinations, and sets ARC secrets from either GHES inputs or dotcom defaults. |
README.md |
Documents GHES usage and lists the new CLI options. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/review |
There was a problem hiding this comment.
Pull request overview
Adds GitHub Enterprise Server (GHES) targeting support to the gh mini-arc extension so ARC can register runners against GHES while the Codespace/repo lifecycle remains on GitHub.com.
Changes:
- Added
-g <config-url>and-p <token>flags togh-mini-arc, including basic validation and wiring intoFAST_ARC_TOKEN/ARC_CONFIG_URLsecrets. - Documented GHES usage and consolidated/expanded the options table in
README.md.
Show a summary per file
| File | Description |
|---|---|
gh-mini-arc |
Adds CLI flags and logic to set ARC token/config URL based on GHES inputs. |
README.md |
Documents GHES mode and updates options/usage guidance. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Export GH_HOST=github.com so gh commands always target dotcom - Pipe ARC token via stdin to avoid exposure in process args Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds GitHub Enterprise Server (GHES) targeting support to the gh mini-arc extension while keeping the default dotcom behavior unchanged (Codespace + repo creation still happens on github.com; only ARC registration can be pointed at GHES).
Changes:
- Added
-g(GHESgithubConfigUrl) and-p(GHES PAT) flags with validation ingh-mini-arc. - Parameterized ARC token/config URL selection based on whether
-gis provided. - Updated README with GHES usage guidance and an updated Options table.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents GHES workflow/flags and consolidates Options. |
| gh-mini-arc | Implements -g/-p parsing + validation, forces GH_HOST=github.com, and switches ARC token/config URL selection logic. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds support for configuring Actions Runner Controller (ARC) against a GitHub Enterprise Server (GHES) instance while still creating the Codespace/repository on GitHub.com, by introducing new CLI flags and documenting GHES usage.
Changes:
- Added
-g(GHES ARC config URL) and-p(GHES PAT) flags togh-mini-arc, with validation and conditional secret/config URL wiring. - Forced
ghCLI calls in the script to targetgithub.comviaGH_HOSTto keep Codespaces/repo creation on dotcom. - Updated
README.mdwith a GHES Support section and consolidated options table.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents GHES usage and adds -g / -p to the options list. |
| gh-mini-arc | Implements new flags, validates combinations, and parameterizes ARC secrets/config URL for GHES vs dotcom. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
| REPO_NAME="fast-arc-$(date +%s)" | ||
| GHES_CONFIG_URL="" | ||
| GHES_PAT_FLAG=false | ||
|
|
||
| while getopts ":s:t:n:h" opt; do | ||
| while getopts ":s:t:n:g:p:h" opt; do |
There was a problem hiding this comment.
Pull request overview
Adds optional GitHub Enterprise Server (GHES) targeting for ARC runner registration while keeping Codespaces/repo creation on GitHub.com.
Changes:
- Added
-g(GHESgithubConfigUrl) and-p(GHES PAT /GHES_PAT) flags with basic cross-flag validation. - Forced
ghcommands to targetgithub.comviaGH_HOST=github.com, and switched secret setting to pipe token via stdin. - Updated README with GHES usage guidance and consolidated options.
Show a summary per file
| File | Description |
|---|---|
gh-mini-arc |
Adds GHES flags, resolves token/config URL based on GHES mode, and ensures dotcom targeting for gh commands. |
README.md |
Documents GHES mode, prerequisites, and flags/options. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
| @@ -20,13 +25,25 @@ while getopts ":s:t:n:h" opt; do | |||
| TEMPLATE_REPO="$(echo $OPTARG | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-' | cut -c 1-100)" | |||
| # All gh commands target dotcom (repo/codespace creation requires github.com) | ||
| export GH_HOST=github.com | ||
|
|
||
| REPO_OWNER="$(gh api user --jq '.login')" | ||
| TEMPLATE_REPO="BagToad/mini-arc-template" |
| printf '%s' "${ARC_TOKEN}" | gh secret set FAST_ARC_TOKEN -a codespaces --repo ${REPO_OWNER}/${REPO_NAME} | ||
| if [ $? -ne 0 ]; then | ||
| exit 1 | ||
| fi |
Adds two new flags to support pointing ARC at a GitHub Enterprise Server instance:
-g <config-url>— Full ARCgithubConfigUrlfor GHES (e.g.https://ghes.example.com/org/repo)-p <token>— PAT for authenticating ARC against GHES (or setGHES_PATenv var)Default behavior is unchanged
When neither flag is provided, everything works exactly as before — ARC targets the dotcom repo created by the extension, using the current
gh auth token.GHES usage
The Codespace still runs on dotcom — only the ARC runner registration targets GHES.
Changes
gh-mini-arc: Added-gand-pflags, validation (-grequires a PAT,-prequires-g), explicitif/elseto resolve token and config URL based on GHES mode,GH_HOST=github.comto ensure dotcom targeting, token piped via stdinREADME.md: Added GHES Support section, consolidated Options table, added dotcom auth prerequisite