Raw output
";
print "";
print "```";
}
# Print all lines anyway
{ print }
# This is a "Updated input 'x'" ine
$3 ~ /input/ {
input = unquote($4);
operations[input] = $2;
next;
}
# This is a "'type:foo/bar/1234' (2021-01-01)" line
$2 ~ /\(.*\)/ {
input_from[input] = unquote($1)
input_from_date[input] = substr($2, 2, 10);
next;
}
# This is a "→ 'type:foo/bar/1234' (2021-01-01)" line
$3 ~ /\(.*\)/ {
input_to[input] = unquote($2)
input_to_date[input] = substr($3, 2, 10);
next;
}
END {
print "```";
print "";
print "
";
print "";
# Once we gathered the information we needed, we can show it properly
for (input in operations) {
operation = operations[input];
details = "";
link = "";
# For "updated" inputs, we have two flake refs
if (operation == "Updated") {
from = input_from[input];
to = input_to[input];
from_date = input_from_date[input]
to_date = input_to_date[input]
parse_flakeref(from, parsed_from);
parse_flakeref(to, parsed_to);
type = parsed_to["type"];
repo = parsed_to["repo"];
from_commit = parsed_from["commit"];
to_commit = parsed_to["commit"];
compare = sprintf("`%s` ➡️ `%s`", short(from_commit), short(to_commit));
# Render the details according to the ref type
if (type == "github") {
compare = sprintf("[%s](https://github.com/%s/compare/%s...%s)", compare, repo, from_commit, to_commit);
link = sprintf("https://github.com/%s", repo);
} else if (type == "gitlab") {
compare = sprintf("[%s](https://gitlab.com/%s/-/compare/%s...%s)", compare, repo, from_commit, to_commit);
link = sprintf("https://gitlab.com/%s", repo);
}
details = sprintf("%s