Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
886a8f7
Initial plan
Copilot Feb 27, 2026
b5fbe72
Add current: true checkout flag to mark logical current repository
Copilot Feb 27, 2026
688ab13
Populate GitHub context prompt with full checkout list
Copilot Feb 28, 2026
b137b96
docs: document checkout current: true flag in cross-repository reference
Copilot Feb 28, 2026
fc7251a
Merge main, fix current validation + normalize path dot, recompile
Copilot Feb 28, 2026
07fd42b
Show full GITHUB_WORKSPACE path and cwd annotation in checkout prompt
Copilot Feb 28, 2026
9573d09
fix: use token: not github-token: in generated actions/checkout YAML
Copilot Feb 28, 2026
5f7b7b8
Merge main into branch; recompile all workflows
Copilot Feb 28, 2026
34e23c3
Merge branch 'main' into copilot/update-checkout-current-repo
pelikhan Feb 28, 2026
5eb1154
Update pkg/workflow/checkout_manager_test.go
pelikhan Feb 28, 2026
06a3c7e
fix: remove path:. from root checkout examples; fix duplicate renderG…
Copilot Feb 28, 2026
3659896
Merge branch 'main' into copilot/update-checkout-current-repo
pelikhan Feb 28, 2026
52e2952
Merge branch 'main' into copilot/update-checkout-current-repo
pelikhan Feb 28, 2026
7e0e292
fix: normalize path '.' to '' in add() so empty and dot paths always …
Copilot Feb 28, 2026
5bee2d3
fix: update golden files and codex test for payloadSizeThreshold remo…
Copilot Feb 28, 2026
3b8e283
fix: resolve lint issues - testifylint in checkout test, remove unuse…
Copilot Feb 28, 2026
26887ab
Add changeset [skip-ci]
Feb 28, 2026
edf0893
ci: trigger CI checks
github-actions[bot] Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/patch-document-current-checkout.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .github/workflows/smoke-codex.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .github/workflows/smoke-codex.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ safe-outputs:
run-failure: "🌑 The shadows whisper... [{workflow_name}]({run_url}) {status}. The oracle requires further meditation..."
timeout-minutes: 15
checkout:
fetch-depth: 2
- fetch-depth: 2
current: true
---

# Smoke Test: Codex Engine Validation
Expand Down
20 changes: 16 additions & 4 deletions docs/src/content/docs/reference/cross-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ You can also use `checkout:` to check out additional repositories alongside the

```yaml wrap
checkout:
- path: .
fetch-depth: 0
- fetch-depth: 0
- repository: owner/other-repo
path: ./libs/other
ref: main
Expand All @@ -53,6 +52,7 @@ checkout:
| `sparse-checkout` | string | Newline-separated patterns for sparse checkout (e.g., `.github/\nsrc/`). |
| `submodules` | string/bool | Submodule handling: `"recursive"`, `"true"`, or `"false"`. |
| `lfs` | boolean | Download Git LFS objects. |
| `current` | boolean | Marks this checkout as the primary working repository. The agent uses this as the default target for all GitHub operations. Only one checkout may set `current: true`; the compiler rejects workflows where multiple checkouts enable it. |

### Checkout Merging

Expand All @@ -66,6 +66,18 @@ When multiple `checkout:` entries target the same repository and path, their con
- **Submodules**: First non-empty value wins for each `(repository, path)`; once set, later values are ignored
- **Ref/Token**: First-seen wins

### Marking a Primary Repository (`current: true`)

When a workflow running from a central repository targets a different repository, use `current: true` to tell the agent which repository to treat as its primary working target. The agent uses this as the default for all GitHub operations (creating issues, opening PRs, reading content) unless the prompt instructs otherwise. When omitted, the agent defaults to the repository where the workflow is running.

```yaml wrap
checkout:
- repository: org/target-repo
path: ./target
github-token: ${{ secrets.CROSS_REPO_PAT }}
current: true # agent's primary target
```

## GitHub Tools - Reading Other Repositories

When using [GitHub Tools](/gh-aw/reference/github-tools/) to read information from repositories other than the one where the workflow is running, you must configure additional authorization. The default `GITHUB_TOKEN` is scoped to the current repository only and cannot access other repositories.
Expand All @@ -79,6 +91,7 @@ tools:
github-token: ${{ secrets.CROSS_REPO_PAT }}
```


See [GitHub Tools Reference](/gh-aw/reference/github-tools/#cross-repository-reading) for complete details on configuring cross-repository read access for GitHub Tools.

This authentication is for **reading** information from GitHub. Authorization for **writing** to other repositories (creating issues, PRs, comments) is configured separately, see below.
Expand Down Expand Up @@ -133,8 +146,7 @@ on:
types: [opened, synchronize]

checkout:
- path: .
fetch-depth: 0
- fetch-depth: 0
- repository: org/shared-libs
path: ./libs/shared
ref: main
Expand Down
8 changes: 8 additions & 0 deletions pkg/cli/docker_build_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import (
"testing"
)

// isDockerAvailable checks if Docker is available on the system
func isDockerAvailable() bool {
cmd := exec.Command("docker", "version")
cmd.Stdout = nil
cmd.Stderr = nil
return cmd.Run() == nil
}

// TestDockerfile_Exists verifies the Dockerfile exists and has expected content
func TestDockerfile_Exists(t *testing.T) {
// Get the repository root
Expand Down
8 changes: 0 additions & 8 deletions pkg/cli/docker_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,6 @@ func CheckAndPrepareDockerImages(ctx context.Context, useZizmor, usePoutine, use
return nil
}

// isDockerAvailable checks if Docker is available on the system
func isDockerAvailable() bool {
cmd := exec.Command("docker", "version")
cmd.Stdout = nil
cmd.Stderr = nil
return cmd.Run() == nil
}

// ResetDockerPullState resets the internal pull state (for testing)
func ResetDockerPullState() {
pullState.mu.Lock()
Expand Down
3 changes: 0 additions & 3 deletions pkg/parser/schema_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import (
"maps"

"github.com/github/gh-aw/pkg/constants"
"github.com/github/gh-aw/pkg/logger"
)

var schemaValidationLog = logger.New("parser:schema_validation")

// sharedWorkflowForbiddenFields is a map for O(1) lookup of forbidden fields in shared workflows
var sharedWorkflowForbiddenFields = buildForbiddenFieldsMap()

Expand Down
4 changes: 4 additions & 0 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7898,6 +7898,10 @@
"type": "string",
"description": "GitHub token for authentication. Use ${{ secrets.MY_TOKEN }} to reference a secret. Credentials are always removed after checkout (persist-credentials: false is enforced).",
"examples": ["${{ secrets.MY_PAT }}", "${{ secrets.GITHUB_TOKEN }}"]
},
"current": {
"type": "boolean",
"description": "Marks this checkout as the logical current repository for the workflow. When set to true, the AI agent will treat this repository as its primary working target. Only one checkout may have current set to true. Useful for central-repo workflows targeting a different repository."
}
}
}
Expand Down
Loading
Loading