goreleaser / goreleaser-action

GitHub Action for GoReleaser
https://github.com/marketplace/actions/goreleaser-action
MIT License
833 stars 73 forks source link

Github action - error=hook failed: go mod tidy - when code built with Go version 1.21.0 #429

Closed AaronSaikovski closed 10 months ago

AaronSaikovski commented 10 months ago

What happened? error when running this github action:

name: goreleaser

on: release:

permissions: contents: write

jobs: goreleaser: runs-on: ubuntu-latest steps:

distribution: goreleaser version: latest args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How can we reproduce this? Run goreleaser/goreleaser-action@v4 Downloading https://github.com/goreleaser/goreleaser/releases/download/v1.20.0 /goreleaser_Linux_x86_64.tar.gz Extracting GoReleaser /usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/2b6a486b-b22c-46b4-9b1c-32268719ab77 -f /home/runner/work/_temp/ed885498-6395-4601-9937-cff9054ea79c GoReleaser latest installed successfully /opt/hostedtoolcache/goreleaser-action/1.20.0/x64/goreleaser release --clean • starting release... • loading config file file=.goreleaser.yaml • loading environment variables • using token from $GITHUB_TOKEN • getting and validating git state • building... commit=72ebde44e929080a5e8eb52eb9e47387628c09ce latest tag=v1.1.0 • parsing tag • setting defaults • running before hooks • running hook=go mod tidy ⨯ release failed after 0s error=hook failed: go mod tidy: exit status 1; output: go: go.mod file indicates go 1.21, but maximum version supported by tidy is 1.20

goreleaser version goreleaser: Deliver Go Binaries as fast and easily as possible https://goreleaser.com

GitVersion: 1.20.0 GitCommit: 56c9d09a1b925e2549631c6d180b0a1c2ebfac82 GitTreeState: false BuildDate: 2023-08-10T01:23:44Z BuiltBy: goreleaser GoVersion: go1.21.0 Compiler: gc ModuleSum: h1:wvAbDqQwMX3PWPYc4VIeaWQB2V5HOETvDlyfTrk7NgQ= Platform: darwin/arm64

caarlos0 commented 10 months ago

Your go mod requires go 1.21, but you are running with go 1.20

Not an issue in goreleaser.