From 45f572495e19f82e2731846da3d75503a8ad8a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 24 Jan 2024 11:53:34 +0800 Subject: [PATCH] Fix actions/setup-go usage --- .github/workflows/debug.yml | 12 ++++++------ .github/workflows/lint.yml | 6 +----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index a6df5e83..7f63f6e9 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ">=1.21.0 <1.22.0" + go-version: ^1.21 - name: Add cache to Go proxy run: | version=`git rev-parse HEAD` @@ -48,7 +48,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ">=1.18.0 <1.19.0" + go-version: ~1.18 continue-on-error: true - name: Build run: | @@ -64,7 +64,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ">=1.19.0 <1.20.0" + go-version: ~1.19 continue-on-error: true - name: Build run: | @@ -80,7 +80,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ">=1.20.0 <1.21.0" + go-version: ~1.20 continue-on-error: true - name: Build run: | @@ -96,7 +96,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ">=1.21.0 <1.22.0" + go-version: ^1.21 continue-on-error: true - name: Build run: | @@ -112,7 +112,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ">=1.21.0 <1.22.0" + go-version: ^1.21 continue-on-error: true - name: Build run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2cb57d91..e35ba84a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,14 +21,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Get latest go version - id: version - run: | - echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ${{ steps.version.outputs.go_version }} + go-version: ^1.21 - name: Cache go module uses: actions/cache@v3 with: