Skip to content

Commit

Permalink
Correct URLs in Provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jan 12, 2025
1 parent eb12d69 commit 8981d71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/attestation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def display_data # rubocop:disable Metrics/MethodLength
commit = extensions["1.3.6.1.4.1.57264.1.3"]
ref = extensions["1.3.6.1.4.1.57264.1.14"]
san = extensions["subjectAltName"]
build_file_url = extensions["1.3.6.1.4.1.57264.1.21"]
build_summary_url = extensions["1.3.6.1.4.1.57264.1.21"]
build_file_url = build_summary_url.sub(%r{attempts/\d+\z}, "workflow")

case issuer
when "https://token.actions.githubusercontent.com"
Expand All @@ -38,9 +39,9 @@ def display_data # rubocop:disable Metrics/MethodLength
{
ci_platform: "GitHub Actions",
source_commit_string: "#{repo}@#{commit[0, 7]}",
source_commit_url: "https://github.com/#{repo}/tree/#{commit}",
source_commit_url: "https://github.com/#{repo}/commit/#{commit}",
build_file_string:, build_file_url:,
build_summary_url: "https://github.com/#{repo}/actions/#{build_file_string.delete_prefix('.github/')}"
build_summary_url:
}
else
raise "Unhandled issuer: #{issuer.inspect}"
Expand Down

0 comments on commit 8981d71

Please sign in to comment.