Skip to content

Commit 0058368

Browse files
authored
Merge branch 'main' into grantbirki/cut-new-release
2 parents 33a5566 + 169b8b6 commit 0058368

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ jobs:
159159
needs: ruby-versions
160160
runs-on: ubuntu-latest
161161
name: Smoketest
162-
permissions:
163-
id-token: write
162+
permissions: {}
164163
strategy:
165164
fail-fast: false
166165
matrix:
@@ -186,12 +185,15 @@ jobs:
186185
id: list-gems
187186
run: |
188187
echo "gems=$(find pkg -type f -name '*.gem' -print0 | xargs -0 jq --compact-output --null-input --args '[$ARGS.positional[]]')" >> $GITHUB_OUTPUT
188+
- name: Fetch testing OIDC token
189+
uses: sigstore-conformance/extremely-dangerous-public-oidc-beacon@4a8befcc16064dac9e97f210948d226e5c869bdc # v1.0.0
189190
- name: Run the smoketest
190191
run: |
191192
./bin/smoketest ${BUILT_GEMS}
192193
env:
193194
BUILT_GEMS: ${{ join(fromJson(steps.list-gems.outputs.gems), ' ') }}
194-
WORKFLOW_NAME: ci
195+
OIDC_TOKEN_FILE: ./oidc-token.txt
196+
SIGSTORE_CERT_IDENTITY: https://github.com/sigstore-conformance/extremely-dangerous-public-oidc-beacon/.github/workflows/extremely-dangerous-oidc-beacon.yml@refs/heads/main
195197

196198
all-tests-pass:
197199
if: always()

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
./bin/smoketest ${BUILT_GEMS}
6565
env:
6666
BUILT_GEMS: ${{ join(fromJson(steps.list-gems.outputs.gems), ' ') }}
67+
SIGSTORE_CERT_IDENTITY: ${{ github.server_url }}/${{ github.repository }}/.github/workflows/release.yml@${{ github.ref }}
6768

6869
- name: Generate hashes for provenance
6970
shell: bash

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sigstore
22

3-
This is a pure Ruby implementation of the `sigstore verify` command from the [sigstore/cosign](https://sigstore.dev/projects/cosign) project. It is intended to be used as a library in other Ruby projects, in additional to a `gem` subcommand. The project also contains a TUF client implementation, given TUF is a part of the sigstore verification flow.
3+
This is a pure Ruby implementation of the `sigstore verify` command from the [sigstore/cosign](https://sigstore.dev/projects/cosign) project. It is intended to be used as a library in other Ruby projects or directly through a new `gem` subcommand. The project also contains a TUF client implementation, given TUF is a part of the sigstore verification flow.
44

55
## Usage
66

bin/smoketest

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ env = {
2222
"BUNDLE_GEMFILE" => "smoketest-gem-home/Gemfile"
2323
}
2424

25-
cert_identity = "#{ENV.fetch("GITHUB_SERVER_URL")}/#{ENV.fetch("GITHUB_REPOSITORY")}" \
26-
"/.github/workflows/#{ENV.fetch("WORKFLOW_NAME", "release")}.yml@#{ENV.fetch("GITHUB_REF")}"
25+
# Get cert identity from environment
26+
cert_identity = ENV.fetch("SIGSTORE_CERT_IDENTITY")
27+
28+
# Read OIDC token from file if available
29+
oidc_token_file = ENV.fetch("OIDC_TOKEN_FILE", nil)
30+
oidc_token = (File.read(oidc_token_file).strip if oidc_token_file && File.exist?(oidc_token_file))
2731

2832
sh(env, "gem", "install", *dists, "--no-document", exception: true)
2933

@@ -32,12 +36,22 @@ File.write("smoketest-gem-home/Gemfile", <<~RUBY)
3236
RUBY
3337

3438
dists.each do |dist|
35-
sh(env, File.expand_path("sigstore-cli", __dir__),
36-
"sign", dist,
37-
"--signature=smoketest-artifacts/#{File.basename(dist)}.sig",
38-
"--certificate=smoketest-artifacts/#{File.basename(dist)}.crt",
39-
"--bundle=smoketest-artifacts/#{File.basename(dist)}.sigstore.json",
40-
exception: true)
39+
# Build sign command with optional identity token
40+
sign_cmd = [
41+
File.expand_path("sigstore-cli", __dir__),
42+
"sign",
43+
dist
44+
]
45+
46+
sign_cmd.push("--identity-token", oidc_token) if oidc_token
47+
48+
sign_cmd.push(
49+
"--signature=smoketest-artifacts/#{File.basename(dist)}.sig",
50+
"--certificate=smoketest-artifacts/#{File.basename(dist)}.crt",
51+
"--bundle=smoketest-artifacts/#{File.basename(dist)}.sigstore.json"
52+
)
53+
54+
sh(env, *sign_cmd, exception: true)
4155

4256
sh(env, File.expand_path("sigstore-cli", __dir__),
4357
"verify",

0 commit comments

Comments
 (0)