diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index bf67c2d..12f1955 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,6 +15,12 @@ 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 - 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"