fix: clear VCS cache instead of fixing remotes
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Lint (push) Failing after 53s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Unit Tests (push) Failing after 50s
Build and Release / Integration Tests (PostgreSQL) (push) Failing after 42s
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Lint (push) Failing after 53s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Unit Tests (push) Failing after 50s
Build and Release / Integration Tests (PostgreSQL) (push) Failing after 42s
The previous approach tried to fix git remotes in bare repos, but that was unreliable. This simpler approach: 1. Sets up URL rewriting (insteadOf) for git 2. Clears the VCS cache entirely to force fresh fetches 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,19 +42,10 @@ jobs:
|
||||
|
||||
- name: Configure git for public modules
|
||||
run: |
|
||||
# Update any cached VCS remotes from direct to public URL
|
||||
for dir in /root/go/pkg/mod/cache/vcs/*/; do
|
||||
if [ -d "$dir/.git" ] || [ -d "$dir/refs" ]; then
|
||||
cd "$dir"
|
||||
REMOTE=$(git remote get-url origin 2>/dev/null || echo "")
|
||||
if echo "$REMOTE" | grep -q "direct.git.marketally.com"; then
|
||||
NEW_REMOTE=$(echo "$REMOTE" | sed 's|direct.git.marketally.com|git.marketally.com|g')
|
||||
echo "Updating $dir remote: $REMOTE -> $NEW_REMOTE"
|
||||
git remote set-url origin "$NEW_REMOTE" || true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# Set up URL rewriting so git uses public URL
|
||||
git config --global url."https://git.marketally.com/".insteadOf "https://direct.git.marketally.com/"
|
||||
# Clear VCS cache to force fresh fetch with rewritten URL
|
||||
rm -rf "$(go env GOPATH)/pkg/mod/cache/vcs" || true
|
||||
|
||||
- name: Update vault dependency
|
||||
env:
|
||||
@@ -106,10 +97,10 @@ jobs:
|
||||
|
||||
- name: Configure git for public modules
|
||||
run: |
|
||||
for dir in /root/go/pkg/mod/cache/vcs/*/; do
|
||||
[ -d "$dir" ] && cd "$dir" && git remote set-url origin "$(git remote get-url origin | sed 's|direct.git.marketally.com|git.marketally.com|g')" 2>/dev/null || true
|
||||
done
|
||||
# Set up URL rewriting so git uses public URL
|
||||
git config --global url."https://git.marketally.com/".insteadOf "https://direct.git.marketally.com/"
|
||||
# Clear VCS cache to force fresh fetch with rewritten URL
|
||||
rm -rf "$(go env GOPATH)/pkg/mod/cache/vcs" || true
|
||||
|
||||
- name: Update vault dependency
|
||||
env:
|
||||
@@ -168,10 +159,10 @@ jobs:
|
||||
|
||||
- name: Configure git for public modules
|
||||
run: |
|
||||
for dir in /root/go/pkg/mod/cache/vcs/*/; do
|
||||
[ -d "$dir" ] && cd "$dir" && git remote set-url origin "$(git remote get-url origin | sed 's|direct.git.marketally.com|git.marketally.com|g')" 2>/dev/null || true
|
||||
done
|
||||
# Set up URL rewriting so git uses public URL
|
||||
git config --global url."https://git.marketally.com/".insteadOf "https://direct.git.marketally.com/"
|
||||
# Clear VCS cache to force fresh fetch with rewritten URL
|
||||
rm -rf "$(go env GOPATH)/pkg/mod/cache/vcs" || true
|
||||
|
||||
- name: Update vault dependency
|
||||
env:
|
||||
@@ -323,25 +314,21 @@ jobs:
|
||||
- name: Configure git for public modules (Unix)
|
||||
if: matrix.goos != 'windows'
|
||||
run: |
|
||||
for dir in /root/go/pkg/mod/cache/vcs/*/; do
|
||||
[ -d "$dir" ] && cd "$dir" && git remote set-url origin "$(git remote get-url origin | sed 's|direct.git.marketally.com|git.marketally.com|g')" 2>/dev/null || true
|
||||
done
|
||||
# Set up URL rewriting so git uses public URL
|
||||
git config --global url."https://git.marketally.com/".insteadOf "https://direct.git.marketally.com/"
|
||||
# Clear VCS cache to force fresh fetch with rewritten URL
|
||||
rm -rf "$(go env GOPATH)/pkg/mod/cache/vcs" || true
|
||||
|
||||
- name: Configure git for public modules (Windows)
|
||||
if: matrix.goos == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
Get-ChildItem "$env:USERPROFILE\go\pkg\mod\cache\vcs" -Directory -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
Push-Location $_.FullName
|
||||
$remote = git remote get-url origin 2>$null
|
||||
if ($remote -like "*direct.git.marketally.com*") {
|
||||
$newRemote = $remote -replace "direct.git.marketally.com", "git.marketally.com"
|
||||
git remote set-url origin $newRemote 2>$null
|
||||
}
|
||||
Pop-Location
|
||||
}
|
||||
# Set up URL rewriting so git uses public URL
|
||||
git config --global url."https://git.marketally.com/".insteadOf "https://direct.git.marketally.com/"
|
||||
# Clear VCS cache to force fresh fetch with rewritten URL
|
||||
$gopath = (go env GOPATH)
|
||||
$vcsPath = Join-Path $gopath "pkg\mod\cache\vcs"
|
||||
if (Test-Path $vcsPath) { Remove-Item -Recurse -Force $vcsPath }
|
||||
|
||||
- name: Update vault dependency (Unix)
|
||||
if: matrix.goos != 'windows'
|
||||
@@ -600,10 +587,10 @@ jobs:
|
||||
|
||||
- name: Configure git for public modules
|
||||
run: |
|
||||
for dir in /root/go/pkg/mod/cache/vcs/*/; do
|
||||
[ -d "$dir" ] && cd "$dir" && git remote set-url origin "$(git remote get-url origin | sed 's|direct.git.marketally.com|git.marketally.com|g')" 2>/dev/null || true
|
||||
done
|
||||
# Set up URL rewriting so git uses public URL
|
||||
git config --global url."https://git.marketally.com/".insteadOf "https://direct.git.marketally.com/"
|
||||
# Clear VCS cache to force fresh fetch with rewritten URL
|
||||
rm -rf "$(/usr/local/go/bin/go env GOPATH)/pkg/mod/cache/vcs" || true
|
||||
|
||||
- name: Update vault dependency
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user