Skip to content

Commit 6799704

Browse files
authored
Fix not found error for attestation build summary URL (#5365)
* Fix not found error for attestation build summary URL * Correct URLs in Provenance
1 parent 763630d commit 6799704

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/models/attestation.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def display_data # rubocop:disable Metrics/MethodLength
2929
commit = extensions["1.3.6.1.4.1.57264.1.3"]
3030
ref = extensions["1.3.6.1.4.1.57264.1.14"]
3131
san = extensions["subjectAltName"]
32-
build_file_url = extensions["1.3.6.1.4.1.57264.1.21"]
32+
build_summary_url = extensions["1.3.6.1.4.1.57264.1.21"]
33+
build_file_url = build_summary_url.sub(%r{attempts/\d+\z}, "workflow")
3334

3435
case issuer
3536
when "https://token.actions.githubusercontent.com"
@@ -38,9 +39,9 @@ def display_data # rubocop:disable Metrics/MethodLength
3839
{
3940
ci_platform: "GitHub Actions",
4041
source_commit_string: "#{repo}@#{commit[0, 7]}",
41-
source_commit_url: "https://github.com/#{repo}/tree/#{commit}",
42+
source_commit_url: "https://github.com/#{repo}/commit/#{commit}",
4243
build_file_string:, build_file_url:,
43-
build_summary_url: "https://github.com/#{repo}/actions/runs/#{build_file_string}"
44+
build_summary_url:
4445
}
4546
else
4647
raise "Unhandled issuer: #{issuer.inspect}"

0 commit comments

Comments
 (0)