Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRE-1805 - Sign Package Collector Image #168

Merged
merged 5 commits into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/actions/sign_ghcr/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sign Package Collector Image
description: |
This action is responsible for signing the Docker image of the Package Collector
and pushing the signature to the GitHub Container Registry (GHCR).

inputs:
image-name:
description: 'The name of the image.'
required: true
image-digest:
description: 'The digest of the image.'
required: true
PACKAGE_GITHUB_TOKEN:
description: 'GitHub Token to authenticate and sign with'
required: true

runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Cosign
uses: sigstore/cosign-installer@v3
- name: Log into registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.PACKAGE_GITHUB_TOKEN }}
# Sign the Docker image (Using OIDC Token for "keyless signing")
# https://github.com/sigstore/cosign-installer
- name: Sign the images with GH OIDC Token
shell: bash
run: |
cosign sign -y $IMAGE
env:
COSIGN_REPOSITORY: ghcr.io/${{ inputs.image-name }}-signatures
IMAGE: ghcr.io/${{ inputs.image-name }}@${{ inputs.image-digest }}
Loading