diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 32db546..8a6ffc2 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -15,6 +15,12 @@ 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 - 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"