From 9d6dcccab5c825fa597b6141f35acbeeacae5035 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 5 Mar 2024 21:39:02 +0800 Subject: [PATCH] ci: refactor CI workflows and update Go version management - Update CodeQL GitHub Action from version 2 to version 3 in codeql.yml - Replace static Go version with dynamic version from go.mod and enable check for latest Go version in goreleaser.yml - Add Checkout repository step to lint.yml workflow - Replace static Go version with dynamic version from go.mod and enable check for latest Go version in lint.yml workflow Signed-off-by: Bo-Yi Wu --- .github/workflows/codeql.yml | 2 +- .github/workflows/goreleaser.yml | 3 ++- .github/workflows/lint.yml | 9 ++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8100564..f3ceec8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -51,4 +51,4 @@ jobs: # queries: ./path/to/local/query, your-org/your-repo/queries@main - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 5dab80f..8602ec8 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -19,7 +19,8 @@ jobs: - name: Setup go uses: actions/setup-go@v5 with: - go-version: "^1" + go-version-file: go.mod + check-latest: true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 92b39dc..2b4ac9d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,12 +8,15 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup go uses: actions/setup-go@v5 with: - go-version: "^1" - - name: Checkout repository - uses: actions/checkout@v4 + go-version-file: go.mod + check-latest: true + - name: Setup golangci-lint uses: golangci/golangci-lint-action@v4 with: