From cf2715a87d16c8bee91c49177a063b440dbad6ae Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 17 Feb 2026 20:52:00 -0500 Subject: [PATCH] ci: add upstream mapping sync check to quality workflow Problem: mapping.lua can silently fall behind the ya2s/nonicons font repo with no indication that new icons are available. Solution: add a mapping-sync job that fetches nonicon.json from upstream, generates the expected mapping.lua, and fails the check if they differ. --- .github/workflows/quality.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index 77049fd..ffcb9af 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -87,3 +87,29 @@ jobs: run: pnpm add -g prettier@3.1.0 - name: Check markdown formatting with prettier run: prettier --check . + + mapping-sync: + name: Mapping Sync Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check mapping against upstream + run: | + curl -sL https://raw.githubusercontent.com/ya2s/nonicons/main/src/template/nonicon.json \ + | jq -S 'to_entries | map({key: (.key | sub("-16$"; "")), value: .value}) | from_entries' \ + > /tmp/upstream.json + + { + echo '---@type table' + echo 'local M = {' + jq -r 'to_entries | sort_by(.key) | .[] | " ['"'"'\(.key)'"'"'] = \(.value),"' /tmp/upstream.json + echo '}' + echo 'return M' + } > /tmp/expected.lua + + if ! diff -u lua/nonicons/mapping.lua /tmp/expected.lua; then + echo '' + echo '::warning::mapping.lua is out of sync with ya2s/nonicons upstream' + echo 'Run the sync script or update lua/nonicons/mapping.lua manually.' + exit 1 + fi