diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index a7116a562670a..500aa36f1034c 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -75,9 +75,12 @@ jobs: - name: Install crane to get digest of image uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4 - - name: Sign Argo CD latest image + - name: Get digest of image run: | echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:latest)" >> $GITHUB_ENV + + - name: Sign Argo CD latest image + run: | cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argocd@${{ env.IMAGE_DIGEST }} # Displays the public key to share. cosign public-key --key env://COSIGN_PRIVATE_KEY diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bd5be355b7f19..564eb0f044e76 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -222,9 +222,12 @@ jobs: - name: Install crane to get digest of image uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4 + - name: Get digest of image + run: | + echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:v${TARGET_VERSION})" >> $GITHUB_ENV + - name: Sign Argo CD container images and assets run: | - echo "IMAGE_DIGEST=$(crane digest quay.io/argoproj/argocd:v${TARGET_VERSION})" >> $GITHUB_ENV cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAMESPACE}/argocd@${{ env.IMAGE_DIGEST }} cosign sign-blob --key env://COSIGN_PRIVATE_KEY ./dist/argocd-${TARGET_VERSION}-checksums.txt > ./dist/argocd-${TARGET_VERSION}-checksums.sig # Retrieves the public key to release as an asset