Radish alpha
r
rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE
Radicle CI adapter for native CI
Radicle
Git
feat: put last-updated time stamp to top
Lars Wirzenius committed 2 years ago
commit 49f6711e2224f0c0e9a80154ed3a7b8b805beb54
parent a41e347
1 file changed +6 -6
modified src/report.rs
@@ -64,6 +64,12 @@ fn list_runs(repos: &[&str], run_infos: &[RunInfo]) -> Document {
    doc.push_to_head(&Element::new(Tag::Title).with_text("CI run logs"));
    doc.push_to_head(&Element::new(Tag::Style).with_text(CSS));

+
    let fmt = format_description!("[year]-[month]-[day] [hour]:[minute]:[second]Z");
+
    let now = OffsetDateTime::now_utc().format(fmt).expect("time format");
+

+
    let timestamp = Element::new(Tag::Div).with_text(&format!("Last updated {}.", now));
+
    doc.push_to_body(&timestamp);
+

    for repo in repos {
        let section = Element::new(Tag::H1)
            .with_text("Repository ")
@@ -119,12 +125,6 @@ fn list_runs(repos: &[&str], run_infos: &[RunInfo]) -> Document {
        doc.push_to_body(&list);
    }

-
    let fmt = format_description!("[year]-[month]-[day] [hour]:[minute]:[second]Z");
-
    let now = OffsetDateTime::now_utc().format(fmt).expect("time format");
-

-
    let timestamp = Element::new(Tag::Div).with_text(&format!("Last updated {}.", now));
-
    doc.push_to_body(&timestamp);
-

    doc
}