Skip to content

Commit aa77ed4

Browse files
committed
chore: "Refactor CI/CD workflows for Go environment"
- Standardize cron syntax to use double quotes in codeql.yml - Update CodeQL action version from v2 to v3 in codeql.yml - Change Go version specification to use latest major version in go.yml - Remove specific version of setup-go action in go.yml - Narrow down supported Go versions to 1.18, 1.19, "1.20", 1.21, and 1.22 in go.yml - Standardize tag pattern to use double quotes in goreleaser.yml - Consolidate Checkout and Set up Go steps by removing extra dashes in goreleaser.yml - Update Go version in goreleaser.yml to use latest major version - Update GoReleaser action to v5 in goreleaser.yml Signed-off-by: appleboy <[email protected]>
1 parent e494704 commit aa77ed4

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

.github/workflows/codeql.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [master]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [master]
2020
schedule:
21-
- cron: '41 23 * * 6'
21+
- cron: "41 23 * * 6"
2222

2323
jobs:
2424
analyze:
@@ -32,23 +32,23 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'go' ]
35+
language: ["go"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

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

.github/workflows/go.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@ jobs:
1515
- name: Setup go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: '^1.16'
18+
go-version: "^1"
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
2121
- name: Setup golangci-lint
2222
uses: golangci/golangci-lint-action@v3
2323
with:
24-
version: v1.49.0
2524
args: --verbose
2625
test:
2726
strategy:
2827
matrix:
2928
os: [ubuntu-latest]
30-
go: [1.14, 1.15, 1.16, 1.17, 1.18, 1.19, '1.20']
29+
go: [1.18, 1.19, "1.20", 1.21, 1.22]
3130
include:
3231
- os: ubuntu-latest
3332
go-build: ~/.cache/go-build

.github/workflows/goreleaser.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Goreleaser
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
permissions:
99
contents: write
@@ -12,18 +12,15 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
-
16-
name: Checkout
15+
- name: Checkout
1716
uses: actions/checkout@v4
1817
with:
1918
fetch-depth: 0
20-
-
21-
name: Set up Go
19+
- name: Set up Go
2220
uses: actions/setup-go@v5
2321
with:
24-
go-version: 1.17
25-
-
26-
name: Run GoReleaser
22+
go-version: "^1"
23+
- name: Run GoReleaser
2724
uses: goreleaser/goreleaser-action@v5
2825
with:
2926
# either 'goreleaser' (default) or 'goreleaser-pro'

0 commit comments

Comments
 (0)