Skip to content

Commit 789d288

Browse files
authored
test action against all non-rc releases, verify entry in rekor log (#179)
1 parent e11c089 commit 789d288

File tree

2 files changed

+50
-7
lines changed

2 files changed

+50
-7
lines changed

.github/workflows/test-action.yml

+49-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,38 @@ on:
77
- 'main'
88

99
jobs:
10-
test_cosign_action:
10+
get_all_cosign_releases:
11+
runs-on: ubuntu-latest
12+
permissions: {}
13+
name: Fetch current list of all Cosign releases for testing
14+
outputs:
15+
releases: ${{ steps.get_tags.outputs.result }}
16+
steps:
17+
- name: Get release tags
18+
id: get_tags
19+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
20+
with:
21+
retries: 3
22+
script: |
23+
const response = await github.rest.repos.listReleases({owner:'sigstore',repo:'cosign'});
24+
const releases = response.data.map(release => release.tag_name);
25+
console.log("Found releases: " + releases);
26+
// omits 0.5.0 and 0.6.0 releases because they are tested separately
27+
return releases.filter(rel => !['0.5.0', '0.6.0'].includes(rel));
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
test_default_version_cosign_action:
1132
runs-on: ${{ matrix.os }}
1233
strategy:
1334
matrix:
1435
os: [macos-latest, ubuntu-latest, windows-latest]
1536
permissions: {}
16-
name: Install Cosign and test presence in path
37+
name: Install default version Cosign and test presence in path
1738
steps:
1839
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
persist-credentials: false
1942
- name: Install Cosign
2043
uses: ./
2144
- name: Check install!
@@ -40,6 +63,8 @@ jobs:
4063
name: Install existing release of Cosign and test presence in path
4164
steps:
4265
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66+
with:
67+
persist-credentials: false
4368
- name: Install Cosign
4469
uses: sigstore/cosign-installer@dd6b2e2b610a11fd73dd187a43d57cc1394e35f9 # v3.0.5
4570
- name: Check install!
@@ -55,17 +80,21 @@ jobs:
5580
5681
test_cosign_action_custom:
5782
runs-on: ${{ matrix.os }}
83+
needs: get_all_cosign_releases
5884
strategy:
5985
matrix:
6086
os: [macos-latest, ubuntu-latest, windows-latest]
87+
cosign_release: ${{ fromJson(needs.get_all_cosign_releases.outputs.releases) }}
6188
permissions: {}
62-
name: Install Custom Cosign and test presence in path
89+
name: Install Cosign ${{ matrix.cosign_release }} on ${{ matrix.os }} and test presence in path
6390
steps:
6491
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
92+
with:
93+
persist-credentials: false
6594
- name: Install Cosign
6695
uses: ./
6796
with:
68-
cosign-release: 'v2.2.3'
97+
cosign-release: ${{ matrix.cosign_release }}
6998
- name: Check install!
7099
run: cosign version
71100
- name: Check root directory
@@ -87,6 +116,8 @@ jobs:
87116
name: Install Cosign v0.5.0 and test presence in path
88117
steps:
89118
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
119+
with:
120+
persist-credentials: false
90121
- name: Install Cosign
91122
uses: ./
92123
with:
@@ -112,6 +143,8 @@ jobs:
112143
name: Install Cosign v0.6.0 and test presence in path
113144
steps:
114145
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
146+
with:
147+
persist-credentials: false
115148
- name: Install Cosign
116149
uses: ./
117150
with:
@@ -138,6 +171,8 @@ jobs:
138171
name: Install Cosign v0.6.0 and test presence in path with pre installed libpcsclite1 package
139172
steps:
140173
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174+
with:
175+
persist-credentials: false
141176
- name: Install libpcsclite1
142177
run: |
143178
sudo apt-get update -q
@@ -166,6 +201,8 @@ jobs:
166201
name: Try to install a wrong Cosign
167202
steps:
168203
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
204+
with:
205+
persist-credentials: false
169206
- name: Install Cosign
170207
uses: ./
171208
with:
@@ -181,6 +218,8 @@ jobs:
181218
name: Install Custom Cosign and test presence in path
182219
steps:
183220
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
221+
with:
222+
persist-credentials: false
184223
- name: Install Cosign
185224
uses: ./
186225
with:
@@ -205,6 +244,8 @@ jobs:
205244
name: Install Custom Cosign and test presence in path with custom root dir
206245
steps:
207246
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
247+
with:
248+
persist-credentials: false
208249
- name: Install Cosign
209250
uses: ./
210251
with:
@@ -231,11 +272,13 @@ jobs:
231272
- ubuntu-latest
232273
- windows-latest
233274
go_version:
234-
- '1.21'
235275
- '1.22'
236-
name: Try to install cosign with go ${{ matrix.go_version }}
276+
- '1.23'
277+
name: Try to install cosign with go ${{ matrix.go_version }} on ${{ matrix.os }}
237278
steps:
238279
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
280+
with:
281+
persist-credentials: false
239282
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
240283
with:
241284
go-version: ${{ matrix.go_version }}

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ runs:
253253
fi
254254
255255
log_info "Using bootstrap cosign to verify signature of desired cosign version"
256-
./cosign verify-blob --insecure-ignore-tlog --key public.key --signature ${desired_cosign_filename}.sig cosign_${{ inputs.cosign-release }}
256+
./cosign verify-blob --key public.key --signature ${desired_cosign_filename}.sig cosign_${{ inputs.cosign-release }}
257257
258258
$SUDO rm cosign
259259
$SUDO mv cosign_${{ inputs.cosign-release }} ${cosign_executable_name}

0 commit comments

Comments
 (0)