mirror of
https://github.com/ossf/scorecard.git
synced 2024-10-26 10:28:10 +03:00
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
# Copyright 2021 OpenSSF 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: read-all
|
|
|
|
on:
|
|
push:
|
|
# only publish ghcr images for releases
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
GO_VERSION: 1.22
|
|
|
|
jobs:
|
|
publishimage:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
packages: write
|
|
env:
|
|
COSIGN_EXPERIMENTAL: "true"
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4
|
|
with:
|
|
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
|
|
|
- name: Clone the code
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
check-latest: true
|
|
- name: install ko
|
|
uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
|
|
- name: publishimage
|
|
uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e
|
|
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@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
|
|
- name: Sign image
|
|
run: |
|
|
cosign sign --yes ghcr.io/${{github.repository_owner}}/scorecard/v5:${{ github.sha }}
|