From 632006533b9db5f835ad6aedd893acc299809e54 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 19 Oct 2026 16:25:05 -0600 Subject: [PATCH 1/2] ci: retry Go module downloads --- .github/workflows/pre-commit.yaml | 1 + mise.toml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 32db546..f9dd056 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -17,4 +17,5 @@ jobs: - uses: jdx/mise-action@fc42bcc7ddbf51124c30f95a877a0c5168a3bfde # v5 + - run: mise run setup:dependencies - run: prek run --all-files diff --git a/mise.toml b/mise.toml index d098364..cdf15ed 100644 --- a/mise.toml +++ b/mise.toml @@ -17,8 +17,17 @@ description = "Install dependencies and git hooks" depends = ["setup:dependencies", "setup:hooks"] [tasks."setup:dependencies"] -description = "Download Go modules" -run = "go mod download" +description = "Download Go modules with retries" +run = ''' +attempt=1 +until go mod download; do + if [ "$attempt" -ge 3 ]; then + exit 1 + fi + sleep "$((attempt * 5))" + attempt="$((attempt + 1))" +done +''' [tasks."setup:hooks"] description = "Install prek git hooks" From 1307dcba7be87d09aa3389c70df40dd258e31f44 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 19 Oct 2026 17:07:17 -0600 Subject: [PATCH 2/2] ci: cache Go modules in pre-commit --- .github/workflows/pre-commit.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index f9dd056..8a6ffc2 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - name: setup Go + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 + with: + go-version-file: go.mod + - uses: jdx/mise-action@fc42bcc7ddbf51124c30f95a877a0c5168a3bfde # v5 - run: mise run setup:dependencies