Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
fix(workflow): the real issue :)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybelMekk committed Apr 27, 2023
1 parent 0f152f3 commit b87eeca
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ jobs:
COSIGN_VERSION=${{ env.COSIGN_VERSION }}
GRADLE_VERSION=${{ env.GRADLE_VERSION }}
- name: Set digest
id: digest
run: |
echo "digest=${{ steps.docker_build.outputs.digest }}" >> $GITHUB_OUTPUT
- name: Update major/minor version tag
if: ${{ github.ref == 'refs/heads/main' }}
run: "git tag -f ${{ env.VERSION }}\ngit push -f origin ${{ env.VERSION }} \n"
Expand Down Expand Up @@ -156,19 +151,19 @@ jobs:
- name: Sign Docker image
run: |
echo '${{ secrets.COSIGN_PRIVATE_KEY }}' > cosign.key
cosign sign --yes --key cosign.key ${{ env.IMAGE_NAME }}@{{ env.DIGEST }}
cosign sign --yes --key cosign.key ${{ env.IMAGE_NAME }}@{{ env.DIGEST }}
cosign sign --yes --key cosign.key ${{ env.IMAGE_NAME }}@${{ env.DIGEST }}
cosign sign --yes --key cosign.key ${{ env.IMAGE_NAME }}@${{ env.DIGEST }}
env:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- name: Verify and attach attestation
env:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
run: |
echo '${{ secrets.COSIGN_PUBLIC_KEY }}' > cosign.pub
cosign verify --key cosign.pub ${{ env.IMAGE_NAME }}@{{ env.DIGEST }}
syft attest -o spdx-json ${{ env.IMAGE_NAME }}@{{ env.DIGEST }} > sbom-cli.json
cosign attach attestation --attestation sbom-cli.json ${{ env.IMAGE_NAME }}@{{ env.DIGEST }}
cosign verify-attestation --type spdxjson --key cosign.pub ${{ env.IMAGE_NAME }}@{{ env.DIGEST }} > cosignverify.json
cosign verify --key cosign.pub ${{ env.IMAGE_NAME }}@${{ env.DIGEST }}
syft attest -o spdx-json ${{ env.IMAGE_NAME }}@${{ env.DIGEST }} > sbom-cli.json
cosign attach attestation --attestation sbom-cli.json ${{ env.IMAGE_NAME }}@${{ env.DIGEST }}
cosign verify-attestation --type spdxjson --key cosign.pub ${{ env.IMAGE_NAME }}@${{ env.DIGEST }} > cosignverify.json
- name: Upload provenance
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # ratchet:actions/upload-artifact@v3
with:
Expand Down

0 comments on commit b87eeca

Please sign in to comment.