Skip to content

Commit 8a8c5eb

Browse files
authored
chore: pin GHA by commit, switch to golangci-lint (#823)
1 parent d3d3ef4 commit 8a8c5eb

13 files changed

Lines changed: 53 additions & 37 deletions

File tree

.github/workflows/build.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
build:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v6
28-
- uses: actions/cache@v5
27+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
28+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
2929
with:
3030
path: |
3131
~/go/pkg/mod
@@ -34,18 +34,17 @@ jobs:
3434
key: livekit-cli
3535

3636
- name: Set up Go
37-
uses: actions/setup-go@v6
37+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3838
with:
3939
go-version: "1.25"
4040

4141
- name: Download Go modules
4242
run: go mod download
4343

44-
- name: Static Check
45-
uses: dominikh/staticcheck-action@v1.4.0
44+
- name: Lint
45+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
4646
with:
47-
version: "latest"
48-
install-go: false
47+
version: v2.11.4
4948

5049
- name: Run Go tests
5150
run: go test -v ./...

.github/workflows/docker.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout Git LFS
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3131
with:
3232
lfs: 'true'
3333

3434
- run: git lfs pull
3535

3636
- name: Docker meta
3737
id: meta
38-
uses: docker/metadata-action@v5
38+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
3939
with:
4040
# list of Docker images to use as base name for tags
4141
images: |
@@ -46,20 +46,20 @@ jobs:
4646
type=semver,pattern=v{{major}}.{{minor}}
4747
4848
- name: Set up QEMU
49-
uses: docker/setup-qemu-action@v3
49+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
5050

5151
- name: Set up Docker Buildx
52-
uses: docker/setup-buildx-action@v3
52+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
5353

5454
- name: Login to DockerHub
55-
uses: docker/login-action@v3
55+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
5656
with:
5757
username: ${{ secrets.DOCKERHUB_USERNAME }}
5858
password: ${{ secrets.DOCKERHUB_TOKEN }}
5959

6060
- name: Build and push
6161
id: docker_build
62-
uses: docker/build-push-action@v6
62+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
6363
with:
6464
context: .
6565
push: true

.github/workflows/install-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3131

3232
- name: Run installer
3333
run: bash install-cli.sh

.github/workflows/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Checkout Git LFS
33-
uses: actions/checkout@v6
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3434
with:
3535
lfs: 'true'
3636

@@ -70,7 +70,7 @@ jobs:
7070
- name: Fetch all tags
7171
run: git fetch --force --tags
7272

73-
- uses: actions/cache@v5
73+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
7474
with:
7575
path: |
7676
~/go/pkg/mod
@@ -79,12 +79,12 @@ jobs:
7979
key: livekit-cli
8080

8181
- name: Set up Go
82-
uses: actions/setup-go@v6
82+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
8383
with:
8484
go-version: "1.25"
8585

8686
- name: Run GoReleaser
87-
uses: goreleaser/goreleaser-action@v7
87+
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7
8888
with:
8989
distribution: goreleaser
9090
version: latest

.github/workflows/test.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,21 @@ jobs:
1919
packages: read
2020

2121
steps:
22-
- uses: actions/checkout@v6
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2323

2424
- name: Set up Go
25-
uses: actions/setup-go@v6
25+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
2626
with:
2727
go-version: "1.25"
2828
cache: true
2929

3030
- name: Download Go modules
3131
run: go mod download
3232

33-
- name: Static Check
34-
uses: dominikh/staticcheck-action@v1
33+
- name: Lint
34+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
3535
with:
36-
checks: '["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-SA1019"]'
37-
version: "latest"
38-
install-go: false
36+
version: v2.11.4
3937

4038
- name: Test
4139
shell: bash
@@ -44,7 +42,7 @@ jobs:
4442
go test -race -json -v ./... 2>&1 | tee test.log
4543
4644
- name: Upload test log
47-
uses: actions/upload-artifact@v6
45+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
4846
if: always()
4947
with:
5048
name: test-log-${{ matrix.os }}

.golangci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "2"
2+
linters:
3+
default: none
4+
enable:
5+
- staticcheck
6+
settings:
7+
staticcheck:
8+
checks:
9+
- "all"
10+
- "-ST1000"
11+
- "-ST1003"
12+
- "-ST1016"
13+
- "-ST1020"
14+
- "-ST1021"
15+
- "-ST1022"
16+
- "-SA1019"

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ check_lfs:
3636
fi \
3737
}
3838

39+
lint:
40+
golangci-lint run ./...
41+
3942
fish_autocomplete: cli
4043
./bin/lk generate-fish-completion -o autocomplete/fish_autocomplete

cmd/lk/agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ func createAgentClientWithOpts(ctx context.Context, cmd *cli.Command, opts ...lo
401401
func initAgent(ctx context.Context, cmd *cli.Command) error {
402402
// TODO: (@rektdeckard) move compatibility flag into template index,
403403
// then show template picker containing only compatible templates
404-
if !(cmd.IsSet("lang") || cmd.IsSet("template") || cmd.IsSet("template-url")) {
404+
if !cmd.IsSet("lang") && !cmd.IsSet("template") && !cmd.IsSet("template-url") {
405405
if SkipPrompts(cmd) {
406406
templateURL = "https://github.com/livekit-examples/agent-starter-python"
407407
} else {
@@ -629,7 +629,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error {
629629
fmt.Println("Build completed - You can view build logs later with `lk agent logs --log-type=build`")
630630

631631
if !silent && !SkipPrompts(cmd) {
632-
var viewLogs bool = true
632+
viewLogs := true
633633
if err := huh.NewForm(
634634
huh.NewGroup(
635635
huh.NewConfirm().

cmd/lk/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func main() {
9696
}
9797

9898
func checkForLegacyName() {
99-
if !(strings.HasSuffix(os.Args[0], "lk") || strings.HasSuffix(os.Args[0], "lk.exe")) {
99+
if !strings.HasSuffix(os.Args[0], "lk") && !strings.HasSuffix(os.Args[0], "lk.exe") {
100100
fmt.Fprintf(
101101
os.Stderr,
102102
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPRECATION NOTICE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"+

pkg/agentfs/secrets-file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func DetectEnvFile(maybeFile string, skipPrompts bool) (string, map[string]strin
6767
return selectedFile, env, err
6868
}
6969

70-
var selectedFile string = extantEnvFiles[0]
70+
selectedFile := extantEnvFiles[0]
7171
if err := huh.NewForm(
7272
huh.NewGroup(
7373
huh.NewSelect[string]().

0 commit comments

Comments
 (0)