diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md index c7a2c5d7f2d..89f9b1e46bd 100644 --- a/docs/src/content/docs/reference/safe-outputs.md +++ b/docs/src/content/docs/reference/safe-outputs.md @@ -1631,6 +1631,24 @@ safe-outputs: github-token: ${{ secrets.PR_PAT }} # per-output ``` +`github-token` accepts these GitHub Actions expression forms: + +- `secrets.NAME` +- `needs..outputs.` +- `steps..outputs.` + +The `steps.*.outputs.*` form is useful when the safe-outputs job mints a short-lived token in `pre-steps:` or `setup-steps:` and then reuses that token for `Process Safe Outputs` in the same job. + +```yaml wrap +pre-steps: + - id: fetch_token + run: echo "token=${TOKEN}" >> "$GITHUB_OUTPUT" + +safe-outputs: + github-token: ${{ steps.fetch_token.outputs.token }} + create-pull-request: +``` + ### Using a GitHub App for Authentication (`github-app:`) Use GitHub App tokens for enhanced security: on-demand token minting, automatic revocation, fine-grained permissions, and better attribution. diff --git a/docs/src/content/docs/reference/sandbox.md b/docs/src/content/docs/reference/sandbox.md index 0028136dd41..36ff8a08de5 100644 --- a/docs/src/content/docs/reference/sandbox.md +++ b/docs/src/content/docs/reference/sandbox.md @@ -145,6 +145,28 @@ jobs: Use `go build` or `python3` - both are available. ``` +#### Copilot BYOK request customization (`sandbox.agent.targets.copilot`) + +When routing Copilot through a BYOK-compatible upstream behind the AWF proxy, you can attach custom headers, extra request body fields, and an explicit session identifier on upstream requests: + +```yaml wrap +sandbox: + agent: + targets: + copilot: + extraHeaders: + x-openrouter-title: my-workflow + http-referer: https://github.com/${{ github.repository }} + extraBodyFields: + custom-field: custom-value + sessionId: ${{ github.run_id }} +``` + +Use this for OpenAI-compatible proxies and gateways that expect additional request metadata. `sessionId` is opt-in only; gh-aw does not derive it automatically. + +> [!NOTE] +> Set `sessionId` only when your upstream expects a session identifier. Some strict OpenAI-compatible providers reject unknown `session_id` fields, so automatic injection would be unsafe. + #### Go cache paths in AWF (`GOMODCACHE` / `GOCACHE`) When using `actions/setup-go` in AWF, pin Go cache paths explicitly so restore behavior is predictable: