Skip to content

Commit c588f05

Browse files
authored
chore(ci): update github workflows to latest version and pin to sha
1 parent 3c11fdf commit c588f05

File tree

4 files changed

+38
-34
lines changed

4 files changed

+38
-34
lines changed

.github/workflows/pr.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@ on:
55

66
permissions:
77
contents: read
8-
8+
99
jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- name: Build docker image
16-
run: docker build .
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15+
- name: Build docker image
16+
run: docker build .
1717

1818
lint:
1919
name: Lint
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
fetch-depth: 2
25-
- uses: actions/setup-go@v5
25+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
2626
with:
27-
go-version-file: 'go.mod'
27+
go-version-file: "go.mod"
2828
- name: golangci-lint
29-
uses: golangci/golangci-lint-action@v6
29+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
3030
with:
31-
version: v1.61.0
31+
version: v2.10.1
3232

3333
test:
3434
name: Test
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3838
with:
3939
fetch-depth: 2
40-
- uses: actions/setup-go@v5
40+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
4141
with:
42-
go-version-file: 'go.mod'
42+
go-version-file: "go.mod"
4343
- run: go test ./...

.github/workflows/release-please.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
release_created: ${{steps.release.outputs.release_created }}
2020

2121
steps:
22-
- uses: actions/checkout@v4
23-
- uses: googleapis/release-please-action@v4
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
2424
id: release
2525

2626
release-container:
@@ -31,20 +31,20 @@ jobs:
3131
IMAGE_NAME: ${{ github.repository }}
3232
TAG: ${{ needs.release-please.outputs.version }}
3333
steps:
34-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3535

3636
- name: Set up Docker Buildx
37-
uses: docker/setup-buildx-action@v3
37+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
3838

3939
- name: Log in to the Container registry
40-
uses: docker/login-action@v3
40+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
4141
with:
4242
registry: ${{ env.REGISTRY }}
4343
username: ${{ github.actor }}
4444
password: ${{ secrets.GITHUB_TOKEN }}
4545

4646
- name: Build and push Docker image
47-
uses: docker/build-push-action@v6
47+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
4848
if: ${{needs.release-please.outputs.release_created == 'true'}}
4949
with:
5050
context: .
@@ -60,14 +60,14 @@ jobs:
6060
- name: Extract metadata (tags, labels) for Docker
6161
id: meta
6262
if: ${{ needs.release-please.outputs.release_created != 'true' }}
63-
uses: docker/metadata-action@v5
63+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
6464
with:
6565
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6666
tags: |
6767
type=raw,value=latest-{{date 'YYYYMMDDHHmmss'}}-{{sha}}
6868
6969
- name: Build and push Docker image
70-
uses: docker/build-push-action@v6
70+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
7171
if: ${{ needs.release-please.outputs.release_created != 'true' }}
7272
with:
7373
context: .
@@ -85,7 +85,7 @@ jobs:
8585
needs: release-please
8686
if: ${{needs.release-please.outputs.release_created == 'true'}}
8787
steps:
88-
- uses: actions/checkout@v4
88+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8989
with:
9090
fetch-depth: 0 # important parameter
9191

@@ -95,12 +95,12 @@ jobs:
9595
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
9696
9797
- name: Install Helm
98-
uses: azure/setup-helm@v4
98+
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
9999
env:
100100
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
101101

102102
- name: Run chart-releaser
103-
uses: helm/chart-releaser-action@v1.6.0
103+
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
104104
env:
105105
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
106106
skip_existing: true

.golangci.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
run:
2-
timeout: 30m
1+
version: "2"
32

43
linters:
54
enable:
6-
- errcheck
7-
- gosimple
8-
- govet
9-
- ineffassign
10-
- staticcheck
11-
- unused
125
- zerologlint
6+
- godox # find todos, fixmes and other markers
137

148
issues:
15-
max-same-issues: 0
9+
max-same-issues: 0
10+
11+
formatters:
12+
enable:
13+
- gofmt
14+
exclusions:
15+
paths:
16+
- docs/docs.go

main_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88

99
"github.com/stretchr/testify/assert"
1010
"github.com/stretchr/testify/require"
11+
12+
main "github.com/equinor/radix-ingress-default-backend"
1113
)
12-
import main "github.com/equinor/radix-ingress-default-backend"
1314

1415
func TestRun(t *testing.T) {
1516
router := main.NewRouter(main.NewBackendController())
@@ -53,7 +54,9 @@ func sendRequest(url, namespace, code string) (string, error) {
5354
if err != nil {
5455
return "", err
5556
}
56-
defer regularRequest.Body.Close()
57+
defer func() {
58+
_ = regularRequest.Body.Close()
59+
}()
5760

5861
bytes, err := io.ReadAll(regularRequest.Body)
5962
if err != nil {

0 commit comments

Comments
 (0)