Skip to content

Commit 2240496

Browse files
committed
Limit commit hash length to 7 characters
GitHub uses 7 characters when displaying hash in most places. This does *not* change the table, which still displays the full commit hash, to avoid any ambiguity. Additionally, the permalink is still the full commit hash because who cares.
1 parent 7f3a81e commit 2240496

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

report

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ require "yaml"
77
results = CSV.table("results.csv")
88

99
if ENV.key?("REF") && ENV.key?("PR")
10+
pretty_ref = ENV.fetch("REF")[0...7]
1011
frontmatter = {
1112
"PR" => ENV.fetch("PR"),
12-
"REF" => ENV.fetch("REF"),
13+
"REF" => pretty_ref,
1314
"title" => "Performance Check",
1415
"permalink" => "/#{ENV.fetch "REF"}.html",
1516
}
1617
puts <<~HEADER
1718
#{frontmatter.to_yaml}---
1819
19-
The following report was generated for PR ##{ENV.fetch "PR"}, on commit `#{ENV.fetch "REF"}`
20+
The following report was generated for PR ##{ENV.fetch "PR"}, on commit `#{pretty_ref}`
2021
2122
HEADER
2223
end

0 commit comments

Comments
 (0)