11---
22name : Pull Request Cockpit
3+ permissions : {}
34
45on :
56 pull_request :
@@ -34,21 +35,24 @@ jobs:
3435 runs-on : ubuntu-latest
3536 needs :
3637 - general-checks
38+ permissions :
39+ contents : read
3740 steps :
3841 - name : Checkout Repository
39- uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
42+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4043 with :
44+ persist-credentials : false
4145 submodules : recursive
4246
4347 - name : Setup Helm
44- uses : azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
48+ uses : azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
4549 with :
4650 version : v3.6.2
4751
4852 - name : Setup Rust
49- uses : dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # v1
50- with :
51- toolchain : ${{ env. RUST_VERSION }}
53+ run : |
54+ rustup toolchain install "$RUST_VERSION" --profile minimal
55+ rustup default "$ RUST_VERSION"
5256
5357 - name : Setup Rust Cache
5458 uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
@@ -63,15 +67,16 @@ jobs:
6367
6468 - name : Helm Charts not up-to-date
6569 if : ${{ failure() }}
66- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 .0.1
70+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 .0.0
6771 with :
6872 script : |
6973 core.setFailed('Committed Helm charts were not up to date, please regenerate and re-commit!')
7074
7175 publish :
7276 name : Publish ${{ matrix.runner.arch }} Image
7377 permissions :
74- id-token : write
78+ contents : read
79+ id-token : write # required for keyless image signing via cosign (OIDC token to Sigstore)
7580 runs-on : ${{ matrix.runner.name }}
7681 strategy :
7782 matrix :
@@ -90,22 +95,26 @@ jobs:
9095 - check-charts
9196 steps :
9297 - name : Checkout Repository
93- uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
98+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9499 with :
100+ persist-credentials : false
95101 submodules : recursive
96- - uses : cachix/install-nix-action@6004951b182f8860210c8d6f0d808ec5b1a33d28 # tag=v25
102+ - uses : cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # tag=v31.11.1
97103
98104 - name : Setup Rust
99- uses : dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # v1
100- with :
101- toolchain : ${{ env. RUST_VERSION }}
105+ run : |
106+ rustup toolchain install "$RUST_VERSION" --profile minimal
107+ rustup default "$ RUST_VERSION"
102108
103- - uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5 .0
109+ - uses : actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0 .0
104110 with :
105111 go-version : ${{ env.GO_VERSION }}
106112
107113 - name : Install cosign
108- uses : sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
114+ uses : sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
115+ with :
116+ # pin to the latest Cosign v2.x, V3 changes how we publish (new bundle format / OCI 1.1 referrer signatures)
117+ cosign-release : v2.6.5
109118
110119 - name : Install syft
111120 uses : anchore/sbom-action/download-syft@9246b90769f852b3a8921f330c59e0b3f439d6e9 # v0.20.1
@@ -116,9 +125,11 @@ jobs:
116125 key : pr-stackable-cockpit-chart
117126
118127 - name : Update Version
128+ env :
129+ PR_NUMBER : ${{ github.event.pull_request.number }}
119130 run : |
120131 cargo install --locked cargo-edit --version 0.11.11
121- cargo set-version --offline --package stackable-cockpit 0.0.0-pr${{ github.event.pull_request.number }}
132+ cargo set-version --offline --package stackable-cockpit " 0.0.0-pr$PR_NUMBER"
122133
123134 # Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
124135 # default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
@@ -139,7 +150,8 @@ jobs:
139150 - publish
140151 runs-on : ubuntu-latest
141152 permissions :
142- id-token : write
153+ contents : read
154+ id-token : write # required for keyless image signing via cosign (OIDC token to Sigstore)
143155 env :
144156 NEXUS_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
145157 OCI_REGISTRY_SDP_PASSWORD : ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
@@ -148,21 +160,27 @@ jobs:
148160 OCI_REGISTRY_SDP_CHARTS_USERNAME : " robot$sdp-charts+github-action-build"
149161 steps :
150162 - name : Install cosign
151- uses : sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
163+ uses : sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
164+ with :
165+ # pin to the latest Cosign v2.x, V3 changes how we publish (new bundle format / OCI 1.1 referrer signatures)
166+ cosign-release : v2.6.5
152167 - name : Checkout
153- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
168+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
154169 with :
170+ persist-credentials : false
155171 submodules : recursive
156172 # This step checks if the current run was triggered by a push to a pr (or a pr being created).
157173 # If this is the case it changes the version of this project in all Cargo.toml files to include the suffix
158174 # "-pr<prnumber>" so that the published artifacts can be linked to this PR.
159- - uses : stackabletech/cargo-install-action@main
175+ - uses : stackabletech/cargo-install-action@e3e2dcf8d0f0e5bdbc619bf6ee7560dd68152d3c # main
160176 with :
161177 crate : cargo-edit
162178 bin : cargo-set-version
163179 - name : Update version if PR
164180 if : ${{ github.event_name == 'pull_request' }}
165- run : cargo set-version --offline --package stackable-cockpit 0.0.0-pr${{ github.event.pull_request.number }}
181+ env :
182+ PR_NUMBER : ${{ github.event.pull_request.number }}
183+ run : cargo set-version --offline --package stackable-cockpit "0.0.0-pr$PR_NUMBER"
166184 - name : Build manifest list
167185 run : |
168186 # Creating manifest list
0 commit comments