Skip to content

Commit bbd7f93

Browse files
committed
ci: update all workflows with most of zizmor findings
1 parent 59e56f3 commit bbd7f93

File tree

8 files changed

+80
-26
lines changed

8 files changed

+80
-26
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: "Create cluster using KinD"
3+
permissions: {}
34
on:
45
workflow_dispatch: {}
56
jobs:
@@ -8,18 +9,23 @@ jobs:
89
steps:
910
- name: "Build:checkout"
1011
uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
1114
- name: "Build:buildx"
12-
uses: docker/setup-buildx-action@v3
15+
# this is v3.10.0
16+
uses: docker/setup-buildx-action@29109295f81e9208d7d86ff1c6c12d2833863392
1317
with:
1418
version: v0.9.1 # Buildx version
1519
- name: "Build:login"
16-
uses: docker/login-action@v3
20+
# this is v3.4.0
21+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
1722
with:
1823
registry: ghcr.io
1924
username: ${{ github.actor }}
2025
password: ${{ secrets.GITHUB_TOKEN }}
2126
- name: "Build:dockerimage"
22-
uses: docker/build-push-action@v5
27+
# this is v6.16.0
28+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
2329
with:
2430
context: .
2531
file: Dockerfile.controller
@@ -34,16 +40,19 @@ jobs:
3440
runs-on: ubuntu-latest
3541
steps:
3642
- uses: actions/checkout@v4
43+
with:
44+
persist-credentials: false
3745
- name: "Kustomize Build"
38-
uses: karancode/kustomize-github-action@master
46+
# this is latest master
47+
uses: karancode/kustomize-github-action@883a86ec3535e4e7d0fe6450a85f8325c97d2a7b
3948
with:
4049
kustomize_version: "3.0.0"
4150
kustomize_build_dir: "config/default"
4251
kustomize_output_file: "rendered.yaml"
4352
kustomize_build_options: "--load_restrictor none"
4453
token: ${{ github.token }} # ref: https://github.com/karancode/kustomize-github-action/issues/46
45-
# TODO: setup-kind seems to be not well maintained so check for alternatives
46-
- uses: engineerd/setup-kind@v0.5.0
54+
# this is v0.6.2
55+
- uses: engineerd/setup-kind@71e45b960fc8dd50b4aeabf6eb6ef2ca0920b4c1
4756
with:
4857
version: "v0.20.0"
4958
image: "kindest/node:v1.27.1"
@@ -71,14 +80,17 @@ jobs:
7180
uses: actions/checkout@v4
7281
with:
7382
fetch-depth: 0
83+
persist-credentials: false
7484

7585
- name: Set up Helm
76-
uses: azure/setup-helm@v1
86+
# this is v4.3.0
87+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112
7788
with:
7889
version: v3.7.2
7990

8091
- name: Create kind cluster
81-
uses: helm/[email protected]
92+
# this is v1.12.0
93+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3
8294
with:
8395
node_image: "kindest/node:v1.27.1"
8496

.github/workflows/golangci-lint.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: "Golang Lint"
3+
permissions: {}
34
on:
45
- push
56
- pull_request
@@ -9,12 +10,15 @@ jobs:
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
1215
- uses: actions/setup-go@v5
1316
with:
1417
go-version: '1.23'
1518
cache: false
1619
- name: lint
17-
uses: golangci/golangci-lint-action@v3
20+
# this is v6.5.2
21+
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84
1822
with:
1923
version: v1.61
2024
args: --timeout=5m

.github/workflows/helm-lint.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: Helm Lint
3+
permissions: {}
34
on:
45
# `ct lint` does not work well with tag references on releases.
56
# OTOH, Helm linting on tags is not necessary so long as it
@@ -20,10 +21,12 @@ jobs:
2021
- name: Checkout
2122
uses: actions/checkout@v4
2223
with:
24+
persist-credentials: false
2325
fetch-depth: 0
2426

2527
- name: Set up Helm
26-
uses: azure/setup-helm@v1
28+
# this is v4.3.0
29+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112
2730
with:
2831
version: v3.7.2
2932

@@ -32,7 +35,8 @@ jobs:
3235
python-version: 3.13.1
3336

3437
- name: Set up chart-testing
35-
uses: helm/[email protected]
38+
# this is v2.7.0
39+
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b
3640

3741
- name: Run chart-testing (lint)
3842
run: |

.github/workflows/helm-release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
name: Helm release
3+
permissions: {}
34

45
on:
56
workflow_dispatch: {}
@@ -16,6 +17,8 @@ jobs:
1617
steps:
1718
- name: Checkout repository
1819
uses: actions/checkout@v2
20+
with:
21+
persist-credentials: true # this job is opening a PR in the next steps
1922

2023
- name: Make changes to the file
2124
run: |

.github/workflows/helm-test.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: Helm Test
3+
permissions: {}
34
on:
45
push:
56
# run only on branches and not tags
@@ -19,9 +20,11 @@ jobs:
1920
uses: actions/checkout@v4
2021
with:
2122
fetch-depth: 0
23+
persist-credentials: false
2224

2325
- name: Set up Helm
24-
uses: azure/setup-helm@v1
26+
# this is v4.3.0
27+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112
2528
with:
2629
version: v3.7.2
2730

@@ -30,7 +33,8 @@ jobs:
3033
python-version: 3.13.1
3134

3235
- name: Set up chart-testing
33-
uses: helm/[email protected]
36+
# this is v2.7.0
37+
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b
3438

3539
- name: Run chart-testing (list-changed)
3640
id: list-changed
@@ -42,7 +46,8 @@ jobs:
4246
fi
4347
4448
- name: Create kind cluster
45-
uses: helm/[email protected]
49+
# this is v1.12.0
50+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3
4651
if: steps.list-changed.outputs.changed == 'true'
4752

4853
- name: Run chart-testing (install)

.github/workflows/push.yaml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: "Release k6-operator"
3+
permissions: {}
34

45
on:
56
workflow_dispatch:
@@ -18,30 +19,39 @@ jobs:
1819
steps:
1920
- name: "Build:checkout"
2021
uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
2124
- name: "Set image tag name"
25+
env:
26+
GH_IMAGE_TAG: ${{ github.event.inputs.image_tag }}
27+
GH_TAG_NAME: ${{ github.event.release.tag_name }}
2228
run: |
2329
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
24-
echo "IMAGETAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV
30+
echo "IMAGETAG=${GH_IMAGE_TAG}" >> $GITHUB_ENV
2531
else
26-
echo "IMAGETAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
32+
echo "IMAGETAG=${GH_TAG_NAME}" >> $GITHUB_ENV
2733
fi
2834
- name: "Check image tag name"
2935
run: |
3036
echo "IMAGETAG=${{env.IMAGETAG}}"
3137
- name: Set up QEMU
32-
uses: docker/setup-qemu-action@v3
38+
# this is v3.6.0
39+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
3340
- name: "Build:buildx"
34-
uses: docker/setup-buildx-action@v3
41+
# this is v3.10.0
42+
uses: docker/setup-buildx-action@29109295f81e9208d7d86ff1c6c12d2833863392
3543
with:
3644
version: v0.9.1 # Buildx version
3745
- name: "Build:login"
38-
uses: docker/login-action@v3
46+
# this is v3.4.0
47+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
3948
with:
4049
registry: ghcr.io
4150
username: ${{ github.actor }}
4251
password: ${{ secrets.GITHUB_TOKEN }}
4352
- name: "Build:dockerimage"
44-
uses: docker/build-push-action@v5
53+
# this is v6.16.0
54+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
4555
with:
4656
context: .
4757
push: true
@@ -51,15 +61,17 @@ jobs:
5161
platforms: linux/amd64,linux/arm64
5262
tags: ghcr.io/grafana/k6-operator:latest,ghcr.io/grafana/k6-operator:controller-${{env.IMAGETAG}}
5363
- name: "Build:dockerimage"
54-
uses: docker/build-push-action@v5
64+
# this is v6.16.0
65+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
5566
with:
5667
context: .
5768
push: true
5869
file: Dockerfile.runner
5970
platforms: linux/amd64,linux/arm64
6071
tags: ghcr.io/grafana/k6-operator:latest-runner,ghcr.io/grafana/k6-operator:runner-${{env.IMAGETAG}}
6172
- name: "Build:dockerimage"
62-
uses: docker/build-push-action@v5
73+
# this is v6.16.0
74+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
6375
with:
6476
context: .
6577
push: true
@@ -77,15 +89,21 @@ jobs:
7789
steps:
7890
- name: "Checkout code"
7991
uses: actions/checkout@v4
92+
with:
93+
persist-credentials: true # this job is opening a PR in the next steps
8094
- name: "Set image tag name"
95+
env:
96+
GH_IMAGE_TAG: ${{ github.event.inputs.image_tag }}
97+
GH_TAG_NAME: ${{ github.event.release.tag_name }}
8198
run: |
8299
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
83-
echo "IMAGETAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV
100+
echo "IMAGETAG=${GH_IMAGE_TAG}" >> $GITHUB_ENV
84101
else
85-
echo "IMAGETAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
102+
echo "IMAGETAG=${GH_TAG_NAME}" >> $GITHUB_ENV
86103
fi
87104
- name: "Setup kustomize"
88-
uses: imranismail/setup-kustomize@v2
105+
# this is v2.1.0
106+
uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f
89107
- name: "Bundle"
90108
run: |
91109
cd config/default && kustomize edit set image ghcr.io/grafana/k6-operator=*:controller-${{env.IMAGETAG}} && kustomize build . > ../../bundle.yaml

.github/workflows/unit-test.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: "Unit Test"
3+
permissions: {}
34
on:
45
- push
56
- pull_request
@@ -18,6 +19,8 @@ jobs:
1819
go-version: ${{ matrix.go-version }}
1920
- name: Checkout code
2021
uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
2124
- name: Test
2225
run: |
2326
make test-setup

.github/workflows/yamllint.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
---
22
name: Yaml Lint
3+
permissions: {}
34
on:
45
- push
56
- pull_request
7+
68
jobs:
79
lintAllTheThings:
810
runs-on: ubuntu-latest
911
steps:
1012
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
1115
- name: yaml-lint
12-
uses: ibiqlik/action-yamllint@v3
16+
# this is v3.1.1
17+
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c
1318
with:
1419
file_or_dir: config/**/*.yaml e2e/*.yaml
1520
config_file: .yamllint.yaml

0 commit comments

Comments
 (0)