Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Dec 18, 2023
0 parents commit fc9ccaa
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
41 changes: 41 additions & 0 deletions sign/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Cosign Action - Sign'
author: 'EyeCantCU'
description: 'Signs target container'
inputs:
container:
description: 'Path to target container to sign'
required: true
registry:
description: 'Registry hosting the target container'
required: true
tags:
description: 'Tags used by target container'
required: true
runs:
using: "composite"
steps:
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ inputs.container }}

- name: Install cosign
using: sigstore/cosign-installer@v3.3.0

- name: Sign container image
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ inputs.container }}@${TAGS}
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
TAGS: ${{ inputs.tags }}
21 changes: 21 additions & 0 deletions verify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Cosign Action - Verify'
author: 'EyeCantCU'
description: 'Verifies target container'
inputs:
container:
description: 'Path to target container to verify'
required: true
pubkey:
description: 'Public key used by target container'
required: true
runs:
using: "composite"
steps:
- name: Install cosign
using: sigstore/cosign-installer@v3.3.0

- name: Verify container
shell: bash
run: cosign verify --key ${{ inputs.pubkey }} ${{ inputs.container }}
env:
COSIGN_EXPERIMENTAL: false

0 comments on commit fc9ccaa

Please sign in to comment.