-
Notifications
You must be signed in to change notification settings - Fork 450
68 lines (63 loc) · 2.03 KB
/
publishimage.yml
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
# Copyright 2021 Security Scorecard Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: publishimage
permissions:
contents: read
id-token: write
packages: write
on:
pull_request:
- main
push:
branches:
- main
worflow_dispatch:
env:
GO_VERSION: 1.17.7
jobs:
env:
COSIGN_EXPERIMENTAL: "true"
unit-test:
name: publishimage
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813 # v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Clone the code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2.3.4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923 # v2.2.0
with:
go-version: ${{ env.GO_VERSION }}
- name: install ko
uses: imjasonh/setup-ko@2c3450ca27f6e6f2b02e72a40f2163c281a1f675 # v0.4
- name: publishimage
uses: nick-invision/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c
with:
max_attempts: 3
retry_on: error
timeout_minutes: 30
command: |
go env -w GOFLAGS=-mod=mod
make install
make scorecard-ko
- name: Install Cosign
uses: sigstore/cosign-installer@f700e6fbbab82f6897758a3af7a8dede4e308656
- name: Sign image
run: |
cosign sign ghcr.io/${{github.repository_owner}}/scorecard:${{ github.sha }}