Skip to content

Commit

Permalink
Use digest to sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
youcefguichi committed Feb 27, 2024
1 parent b9e9184 commit 2b76290
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ jobs:
test:
name: 🤞 Test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -57,25 +51,3 @@ jobs:
run: make build
env:
VERSION: "ci-build"

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}

- name: Install cosign
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: 'v2.1.1'

- name: Sign the OCI artifact
env:
COSIGNKEY: ${{ secrets.COSIGNKEY }}
run: |
echo "$COSIGNKEY" > /home/runner/work/capacitor/capacitor/cosign.key
# keyless mode
cosign sign ghcr.io/gimlet-io/capacitor-manifests:v-cosign-test2 -y
# private pub key
cosign sign --key /home/runner/work/capacitor/capacitor/cosign.key ghcr.io/gimlet-io/capacitor-manifests:v-cosign-test2 -y
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }} # `PAT` is a secret that contains your Personal Access Token with `write:packages` scope
- name: Build and push Gimlet image
id: build-and-push
uses: docker/[email protected]
with:
context: .
Expand Down Expand Up @@ -94,4 +95,4 @@ jobs:
COSIGNKEY: ${{ secrets.COSIGNKEY }}
run: |
# keyless mode
cosign sign ghcr.io/gimlet-io/capacitor-manifests:${{ steps.version.outputs.version }} -y
cosign sign ghcr.io/gimlet-io/capacitor-manifests:${{ steps.build-and-push.outputs.digest }} -y

0 comments on commit 2b76290

Please sign in to comment.