Skip to content

Commit a6dfd4c

Browse files
github-actions[bot]claudepelikhan
authored
docs(cli): clarify automatic gh CLI configuration in GHES agent jobs (#21437)
The compiled agent job now automatically runs configure_gh_for_ghe.sh before agent execution (injected in #21408). Update the GHES section to reflect that no manual configuration is required for the agent itself; manual sourcing is only needed for custom steps outside the agent sandbox. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent 5f84729 commit a6dfd4c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • docs/src/content/docs/setup

docs/src/content/docs/setup/cli.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ Commands that support `--create-pull-request` (such as `gh aw add`, `gh aw add-w
7979

8080
`gh aw audit` and `gh aw add-wizard` also auto-detect the GHES host from the git remote, so running them inside a GHES repository works without setting `GH_HOST` manually.
8181

82-
#### Configuring `gh` CLI in workflow steps on GHES
82+
#### Configuring `gh` CLI on GHES
8383

84-
When agentic workflows run on GitHub Enterprise Server and use custom `steps:` that invoke `gh` CLI commands, source the bundled helper script to configure `gh` for the enterprise host:
84+
The compiled agent job automatically runs `configure_gh_for_ghe.sh` before the agent starts executing. The script detects the GitHub host from the `GITHUB_SERVER_URL` environment variable (set by GitHub Actions on GHES) and configures `gh` to authenticate against it. No configuration is required for the agent to use `gh` CLI commands on your GHES instance.
85+
86+
For custom `steps:` that run outside the agent sandbox (for example, pre-agent data gathering or post-agent reporting), source the helper script manually:
8587

8688
```yaml wrap
8789
steps:
@@ -96,7 +98,7 @@ steps:
9698
gh pr list --state open --limit 200 --json number,title
9799
```
98100

99-
The script automatically detects the GitHub host from the `GITHUB_SERVER_URL` environment variable (set by GitHub Actions on GHES) and configures `gh` to authenticate against it. No manual configuration is needed for standard GHES deployments. The script is installed to `/opt/gh-aw/actions/configure_gh_for_ghe.sh` by the setup action.
101+
The script is installed to `/opt/gh-aw/actions/configure_gh_for_ghe.sh` by the setup action.
100102

101103
> [!NOTE]
102104
> Custom steps run outside the agent firewall sandbox and have access to standard GitHub Actions environment variables including `GITHUB_SERVER_URL`, `GITHUB_TOKEN`, and `GH_TOKEN`.

0 commit comments

Comments
 (0)