Skip to content

Commit 7a8ba8c

Browse files
authored
Merge pull request #70 from paskal/ci/workflow-hardening
ci: harden workflows, upgrade actions, fix caching
2 parents 23a564f + d68a5cd commit 7a8ba8c

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ on:
66
tags:
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
1215

1316
steps:
17+
- name: checkout
18+
uses: actions/checkout@v6
19+
with:
20+
persist-credentials: false
21+
1422
- name: set up go
1523
uses: actions/setup-go@v6
1624
with:
17-
cache-dependency-path: backend/
25+
cache-dependency-path: backend
1826
go-version: "1.25"
1927
id: go
2028

@@ -23,9 +31,6 @@ jobs:
2331
with:
2432
mongoDBVersion: "5.0"
2533

26-
- name: checkout
27-
uses: actions/checkout@v6
28-
2934
- name: build and test
3035
working-directory: backend
3136
run: |
@@ -38,7 +43,7 @@ jobs:
3843
- name: golangci-lint
3944
uses: golangci/golangci-lint-action@v9
4045
with:
41-
version: latest
46+
version: "latest"
4247
working-directory: backend
4348

4449
- name: submit coverage
@@ -50,11 +55,11 @@ jobs:
5055
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5156

5257
- name: set up QEMU
53-
uses: docker/setup-qemu-action@v3
58+
uses: docker/setup-qemu-action@v4
5459

5560
- name: set up Docker Buildx
5661
id: buildx
57-
uses: docker/setup-buildx-action@v3
62+
uses: docker/setup-buildx-action@v4
5863

5964
- name: available platforms
6065
run: echo ${{ steps.buildx.outputs.platforms }}

backend/.golangci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ linters:
2121
- misspell
2222
- nakedret
2323
- nolintlint
24-
- prealloc
2524
- revive
2625
- rowserrcheck
2726
- staticcheck
@@ -34,6 +33,10 @@ linters:
3433
goconst:
3534
min-len: 2
3635
min-occurrences: 2
36+
gosec:
37+
excludes:
38+
- G118
39+
- G120
3740
revive:
3841
enable-all-rules: true
3942
rules:
@@ -51,6 +54,8 @@ linters:
5154
disabled: true
5255
- name: nested-structs
5356
disabled: true
57+
- name: use-slices-sort
58+
disabled: true
5459
gocritic:
5560
disabled-checks:
5661
- hugeParam

0 commit comments

Comments
 (0)