|
66 | 66 | - name: Set up Docker Buildx
|
67 | 67 | uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
68 | 68 |
|
| 69 | + - name: Set up Cosign |
| 70 | + uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 |
| 71 | + |
69 | 72 | - name: Set image name
|
70 | 73 | id: image-name
|
71 | 74 | run: echo "value=ghcr.io/${{ github.repository }}" >> "$GITHUB_OUTPUT"
|
@@ -114,6 +117,19 @@ jobs:
|
114 | 117 | outputs: ${{ steps.build-output.outputs.value }}
|
115 | 118 | # push: ${{ inputs.publish }}
|
116 | 119 |
|
| 120 | + - name: Sign image with GitHub OIDC Token |
| 121 | + if: ${{ inputs.publish && github.repository_owner == 'bank-vaults' }} # Check if the workflow is called by the same GitHub organization |
| 122 | + env: |
| 123 | + DIGEST: ${{ steps.build.outputs.digest }} |
| 124 | + TAGS: ${{ steps.meta.outputs.tags }} |
| 125 | + run: | |
| 126 | + images="" |
| 127 | + for tag in ${TAGS}; do |
| 128 | + images+="${tag}@${DIGEST} " |
| 129 | + done |
| 130 | + |
| 131 | + cosign sign --yes ${images} |
| 132 | +
|
117 | 133 | - name: Set image ref
|
118 | 134 | id: image-ref
|
119 | 135 | run: echo "value=${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT"
|
@@ -186,6 +202,9 @@ jobs:
|
186 | 202 | with:
|
187 | 203 | version: v3.12.0
|
188 | 204 |
|
| 205 | + - name: Set up Cosign |
| 206 | + uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 |
| 207 | + |
189 | 208 | - name: Set chart name
|
190 | 209 | id: chart-name
|
191 | 210 | run: echo "value=${{ github.event.repository.name }}" >> "$GITHUB_OUTPUT"
|
@@ -221,6 +240,13 @@ jobs:
|
221 | 240 | helm package deploy/charts/${{ steps.chart-name.outputs.value }} --version ${{ steps.version.outputs.value }} --app-version ${{ steps.raw-version.outputs.value }}
|
222 | 241 | echo "package=${{ steps.chart-name.outputs.value }}-${{ steps.version.outputs.value }}.tgz" >> "$GITHUB_OUTPUT"
|
223 | 242 |
|
| 243 | + - name: Sign chart with GitHub OIDC Token |
| 244 | + if: ${{ inputs.publish && github.repository_owner == 'bank-vaults' }} # Check if the workflow is called by the same GitHub organization |
| 245 | + env: |
| 246 | + PACKAGE: ${{ steps.build.outputs.package }} |
| 247 | + run: | |
| 248 | + cosign sign-blob --yes $PACKAGE |
| 249 | +
|
224 | 250 | - name: Upload chart as artifact
|
225 | 251 | uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
|
226 | 252 | with:
|
|
0 commit comments