From 9e8ac7e825da824a59592a6824dce25b4a2fb1f9 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 19 Oct 2026 16:25:04 -0600 Subject: [PATCH 1/2] ci: retry Go module downloads --- .github/workflows/pre-commit.yml | 1 + mise.toml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index bf67c2d..519e2c6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,4 +17,5 @@ jobs: - uses: jdx/mise-action@9b200bcecbfd6303e69a4a261b2e09e3757440a7 # v5 + - run: mise run setup:dependencies - run: prek run --all-files diff --git a/mise.toml b/mise.toml index f7b118a..9b72be5 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 2545cd782e94a42fca51133aa97022d5ff480623 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 19 Oct 2026 17:07:03 -0600 Subject: [PATCH 2/2] ci: cache Go modules in pre-commit --- .github/workflows/pre-commit.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 519e2c6..12f1955 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + - name: setup Go + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 + with: + go-version-file: go.mod + - uses: jdx/mise-action@9b200bcecbfd6303e69a4a261b2e09e3757440a7 # v5 - run: mise run setup:dependencies