fix: get-pr-context scripts resolve REPO_ROOT one level too shallow after deployment#6
Merged
markhazleton merged 2 commits intomainfrom Mar 31, 2026
Merged
Conversation
…yment Scripts live 2 levels deep in source (scripts/bash/, scripts/powershell/) but are deployed 3 levels deep (.documentation/scripts/bash/, .documentation/scripts/powershell/). The hardcoded '../..' resolved to .documentation/ instead of the repo root. Both scripts now use `git rev-parse --show-toplevel` first (always correct), with a 3-level-up directory fallback for non-git environments — matching the pattern already used by common.sh/common.ps1. The PowerShell script's $repoRoot is now a plain string (matching Get-RepoRoot in common.ps1), so three $repoRoot.Path references are updated to $repoRoot. Agent-Logs-Url: https://github.com/markhazleton/spec-kit/sessions/68e9588e-12f7-4aaa-91fd-6c14def251d3 Co-authored-by: markhazleton <223906+markhazleton@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix repo root resolution in get-pr-context.ps1
fix: get-pr-context scripts resolve REPO_ROOT one level too shallow after deployment
Mar 31, 2026
markhazleton
approved these changes
Mar 31, 2026
markhazleton
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scripts live 2 levels deep in source (
scripts/bash/,scripts/powershell/) but are packaged into.documentation/scripts/bash/and.documentation/scripts/powershell/— 3 levels deep. The hardcoded../..resolved to.documentation/instead of the repo root, causingCONSTITUTION_EXISTSto always befalseand all derived paths to be wrong.Changes
scripts/powershell/get-pr-context.ps1— replaceResolve-Path "$scriptPath\..\.."withgit rev-parse --show-toplevel, falling back to$scriptPath\..\..\..\;$repoRootis now a plain string so three$repoRoot.Pathreferences are dropped to$repoRootscripts/bash/get-pr-context.sh— replacecd "$SCRIPT_DIR/../.."withgit rev-parse --show-toplevel, falling back tocd "$SCRIPT_DIR/../../.."Both scripts now match the pattern already used by
common.ps1/common.sh(Get-RepoRoot/get_repo_root), which all other scripts depend on correctly.