From d843e3d2c2e89809e3a7e813e25c94594242bfb7 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 13 Apr 2026 09:02:41 +0200 Subject: [PATCH] Show uutils commit hash and date on playground page Emit a version.js alongside the WASM binary in CI recording the coreutils commit used for the build, and display it under the terminal with a link to the commit on GitHub. --- .github/workflows/website.yml | 12 ++++++++++++ content/playground.md | 11 +++++++++++ static/style.css | 11 +++++++++++ 3 files changed, 34 insertions(+) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index fefc951d6..34d54cd65 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -138,6 +138,18 @@ jobs: echo "const WASM_LOCALES = [$(echo "$locales" | sed 's/[^,]*/\"&\"/g')];" \ > ../uutils.github.io/static/wasm/locales.js echo "Available locales: $locales" + # Record the coreutils commit used to build the WASM binary + commit_hash=$(git rev-parse HEAD) + commit_short=$(git rev-parse --short HEAD) + commit_date=$(git show -s --format=%cI HEAD) + cat > ../uutils.github.io/static/wasm/version.js < +

+ + diff --git a/static/style.css b/static/style.css index 7eb88d63d..751b4eada 100644 --- a/static/style.css +++ b/static/style.css @@ -548,6 +548,17 @@ main img { border: 1px solid var(--header-border-color); } +.playground-version { + margin: -0.5em 0 1.5em; + font-size: 0.85em; + color: var(--secondary-text-color, inherit); + opacity: 0.8; +} + +.playground-version:empty { + display: none; +} + #wasm-playground .wasm-loading { display: flex; align-items: center;