From 3b864a763707bd0a27db6e28e50d142a4854e358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Apayd=C4=B1n?= Date: Mon, 3 Jan 2022 05:31:44 -0800 Subject: [PATCH] chore(ci): support go install from main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Batuhan Apaydın --- .github/workflows/test-action.yml | 26 ++++++++++++++++++++++++++ action.yml | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index ec2afda..3f67186 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -241,3 +241,29 @@ jobs: exit 0 fi + test_cosign_with_go_install: + runs-on: ubuntu-latest + permissions: + actions: none + checks: none + contents: none + deployments: none + issues: none + packages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none + name: Try to install cosign with go + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.17.x' + - name: Install Cosign + uses: ./ + with: + cosign-release: 'main' + - name: Check install! + run: cosign version + diff --git a/action.yml b/action.yml index 5487c24..c6386c4 100644 --- a/action.yml +++ b/action.yml @@ -33,6 +33,12 @@ runs: alias log_error="echo \"ERROR:\"" fi set -e + + if [[ ${{ inputs.cosign-release }} == "main" ]]; then + echo "INFO: installing cosign via go install from its main version" + go install github.com/sigstore/cosign/cmd/cosign@main + exit 0 + fi bootstrap_version='v1.4.1' bootstrap_linux_amd64_sha='08ba779a4e6ff827079abed1a6d1f0a0d9e48aea21f520ddeb42ff912f59d268'