Skip to content

Commit 4f4cf4e

Browse files
committed
ci: update GitHub Actions workflows for Go projects
- Update CodeQL action to version 3 in `.github/workflows/codeql.yml` - Update `actions/checkout` to version 4 and add `fetch-depth: 0` in `.github/workflows/go.yml` - Update `golangci/golangci-lint-action` to version 4 in `.github/workflows/go.yml` - Update `actions/cache` to version 4 in `.github/workflows/go.yml` - Update `codecov/codecov-action` to version 4 in `.github/workflows/go.yml` - Change the name of the step from "Checkout" to "Checkout repository" in `.github/workflows/goreleaser.yml` - Update `actions/setup-go` to version 5 and add `go-version-file: go.mod` and `check-latest: true` in `.github/workflows/goreleaser.yml` - Change the `args` from `release --rm-dist` to `release --clean` in `.github/workflows/goreleaser.yml` Signed-off-by: appleboy <[email protected]>
1 parent f12acd5 commit 4f4cf4e

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@v2
54+
uses: github/codeql-action/analyze@v3

.github/workflows/go.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ jobs:
1212
lint:
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
1520
- name: Setup go
1621
uses: actions/setup-go@v5
1722
with:
18-
go-version: "^1.21"
19-
- name: Checkout repository
20-
uses: actions/checkout@v4
23+
go-version-file: go.mod
24+
check-latest: true
2125
- name: Setup golangci-lint
22-
uses: golangci/golangci-lint-action@v3
26+
uses: golangci/golangci-lint-action@v4
2327
with:
2428
version: latest
2529
args: --verbose
@@ -49,7 +53,7 @@ jobs:
4953
with:
5054
ref: ${{ github.ref }}
5155

52-
- uses: actions/cache@v3
56+
- uses: actions/cache@v4
5357
with:
5458
path: |
5559
${{ matrix.go-build }}
@@ -62,6 +66,6 @@ jobs:
6266
go test -v -covermode=atomic -coverprofile=coverage.out
6367
6468
- name: Upload coverage to Codecov
65-
uses: codecov/codecov-action@v3
69+
uses: codecov/codecov-action@v4
6670
with:
6771
flags: ${{ matrix.os }},go-${{ matrix.go }}

.github/workflows/goreleaser.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout
15+
- name: Checkout repository
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
- name: Set up Go
19+
20+
- name: Setup go
2021
uses: actions/setup-go@v5
2122
with:
22-
go-version: "1.21"
23+
go-version-file: go.mod
24+
check-latest: true
2325
- name: Run GoReleaser
2426
uses: goreleaser/goreleaser-action@v5
2527
with:
2628
# either 'goreleaser' (default) or 'goreleaser-pro'
2729
distribution: goreleaser
2830
version: latest
29-
args: release --rm-dist
31+
args: release --clean
3032
env:
3133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)