Raw output
";
35 | print "";
36 | print "```";
37 | }
38 |
39 | # Print all lines anyway
40 | { print }
41 |
42 | # This is a "Updated input 'x'" ine
43 | $3 ~ /input/ {
44 | input = unquote($4);
45 | operations[input] = $2;
46 | next;
47 | }
48 |
49 | # This is a "'type:foo/bar/1234' (2021-01-01)" line
50 | $2 ~ /\(.*\)/ {
51 | input_from[input] = unquote($1)
52 | input_from_date[input] = substr($2, 2, 10);
53 | next;
54 | }
55 |
56 | # This is a "→ 'type:foo/bar/1234' (2021-01-01)" line
57 | $3 ~ /\(.*\)/ {
58 | input_to[input] = unquote($2)
59 | input_to_date[input] = substr($3, 2, 10);
60 | next;
61 | }
62 |
63 | END {
64 | print "```";
65 | print "";
66 | print "
";
67 | print "";
68 |
69 | # Once we gathered the information we needed, we can show it properly
70 | for (input in operations) {
71 | operation = operations[input];
72 | details = "";
73 | link = "";
74 |
75 | # For "updated" inputs, we have two flake refs
76 | if (operation == "Updated") {
77 | from = input_from[input];
78 | to = input_to[input];
79 | from_date = input_from_date[input]
80 | to_date = input_to_date[input]
81 | parse_flakeref(from, parsed_from);
82 | parse_flakeref(to, parsed_to);
83 | type = parsed_to["type"];
84 | repo = parsed_to["repo"];
85 | from_commit = parsed_from["commit"];
86 | to_commit = parsed_to["commit"];
87 |
88 | compare = sprintf("`%s` ➡️ `%s`", short(from_commit), short(to_commit));
89 | # Render the details according to the ref type
90 | if (type == "github") {
91 | compare = sprintf("[%s](https://github.com/%s/compare/%s...%s)", compare, repo, from_commit, to_commit);
92 | link = sprintf("https://github.com/%s", repo);
93 | } else if (type == "gitlab") {
94 | compare = sprintf("[%s](https://gitlab.com/%s/-/compare/%s...%s)", compare, repo, from_commit, to_commit);
95 | link = sprintf("https://gitlab.com/%s", repo);
96 | }
97 |
98 | details = sprintf("%s