Repository navigation
Prevent base config restore from clobbering an external root checkout - #65069
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Custom checkout steps and cross-platform root-path normalization leave clobbering scenarios unresolved.
Review effort: Balanced
Findings: 1
What changed in this PR
Prevents generated PR checkout and config-restore steps from overwriting an external root checkout.
Changes:
- Detects whether the workspace root belongs to
github.repository. - Adds multi-checkout regression coverage.
| File | Description |
|---|---|
pkg/workflow/pr.go |
Gates generated PR checkout and restore steps. |
pkg/workflow/pr_test.go |
Tests external and same-repository root layouts. |
| for _, checkout := range data.CheckoutConfigs { | ||
| if checkout == nil || (filepath.Clean(checkout.Path) != "." && !strings.Contains(checkout.Path, "${{")) { |
There was a problem hiding this comment.
Added a ContainsCheckout guard in pkg/workflow/pr.go and a compile regression confirming both generated steps are omitted for an external custom checkout. The affected lockfiles were recompiled. Commit: 38ae3bb.
|
@copilot Branch refresh has been requested for this PR. Please verify the updated branch state and run the
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Verified the refreshed branch and completed the local PR-finisher checks. The custom-checkout review finding is fixed in |
|
@copilot Please take another pass on this PR. Please refresh the branch if needed, address any outstanding review feedback, and then run the
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Verified the branch is based on the current |
|
@copilot Please take another pass on this PR. Please refresh the branch if needed, address any outstanding review feedback, and then run the Generated by PR Sous Chef for #65069: Prevent base config restore from clobbering an external root checkout
|
Verified the branch is current at |
|
@copilot Please take another pass on this PR. Review feedback appears addressed in follow-up replies, but the review thread is still unresolved. Please verify the resolution on the current head, resolve any remaining thread feedback, refresh the branch if needed, and then run the
|
Verified current HEAD |
|
@copilot add a frontmatter field that allows to completely turn off the generation of this step. Under checkout. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added |
|
@copilot Please take another pass on this PR. Review feedback appears addressed in follow-up replies, but the review thread is still unresolved. Please verify the current head, resolve any remaining thread feedback, refresh the branch if needed, and then run the
|
Verified current head |
|
@copilot Please take another pass on this PR. Review feedback appears addressed in follow-up replies, but the thread is still unresolved. Please verify the current head, resolve any remaining thread feedback, refresh the branch if needed, and then run the \ skill before handing back to maintainers.
|
…-config-folders # Conflicts: # .github/workflows/unbloat-docs.lock.yml Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Refreshed the branch with latest |
|
@copilot please take another pass on this PR. GitHub still shows an unresolved review thread that already has a follow-up response: Please resolve any remaining open review threads, refresh the branch if GitHub offers it, and run the
|
Verified the pushed head |
|
🎉 This pull request is included in a new release. Release: |

In a multi-checkout workflow, the generated restore step could replace the root target repository’s tracked agent-config files with a snapshot from the workflow repository. The preceding PR checkout step also operates on the workspace root.
github.repository. Preserve them when the workflow repository is at root.Run: https://github.com/github/gh-aw/actions/runs/37067406087
https://github.com/github/gh-aw/actions/runs/37090420907 -->
https://github.com/github/gh-aw/actions/runs/37093662552 -->