-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
69 lines (55 loc) · 1.61 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# yamllint disable rule:line-length
---
name: sign image
description: sign image using cosign
inputs:
working-directory:
description: set working directory. Default is ./.
required: false
default: "."
registry:
description: name of registry
required: false
default: docker.io
organization:
description: dtr compatible organization identified
required: false
default: ""
image:
description: name of image
required: true
tag:
description: value for tag
required: false
default: dev.${GITHUB_SHA:0:7}
cosign-attestations:
description: attestations to include in signature
required: false
default: ""
cosign-sign-key:
description: path to private key used to sign image
required: false
default: cosign.key
cosign-verify-key:
description: path to public key used to verify signature
required: false
default: cosign.pub
runs:
using: "composite"
steps:
- name: confirim signing keys are available
working-directory: ${{ inputs.working-directory }}
shell: bash
run: |
if [ ! -f ${{ inputs.cosign-sign-key }} ]; then
echo "signing key not available; not able to sign image."
exit 1
fi
if [ ! -f ${{ inputs.cosign-verify-key }} >> ]; then
echo "verification key not available; not able to validate signing process."
exit 1
fi
- name: sign image
working-directory: ${{ inputs.working-directory }}
shell: bash
run: cosign sign --key ${{ inputs.cosign-sign-key }} ${{ inputs.cosign-attestations }} $(cat manifestid) -y