fix(ci): self-heal module cache on verify failure

This commit is contained in:
Micheal Wilkinson
2026-03-21 15:33:27 +00:00
parent 27a058a3ce
commit ad3d657db9
2 changed files with 16 additions and 2 deletions

View File

@@ -45,8 +45,15 @@ jobs:
- name: Module hygiene
run: |
set -euo pipefail
go mod tidy
go mod verify
if ! go mod verify; then
echo "go mod verify failed; refreshing module cache and retrying" >&2
go clean -modcache
go mod download
go mod verify
fi
- name: Restore cached gosec binary
id: cache-gosec

View File

@@ -41,8 +41,15 @@ jobs:
- name: Module hygiene
run: |
set -euo pipefail
go mod tidy
go mod verify
if ! go mod verify; then
echo "go mod verify failed; refreshing module cache and retrying" >&2
go clean -modcache
go mod download
go mod verify
fi
- name: Restore cached gosec binary
id: cache-gosec