From dbc9ef2446ea26a9aac74699fe8fdfb90be0fec4 Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Thu, 18 Jan 2024 14:51:36 -0600 Subject: [PATCH] use a function --- .github/workflows/repo-banner.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/repo-banner.yml b/.github/workflows/repo-banner.yml index 621ac45e..7d825cf2 100644 --- a/.github/workflows/repo-banner.yml +++ b/.github/workflows/repo-banner.yml @@ -45,7 +45,16 @@ jobs: - name: Format Repo Metadata id: meta + env: + LANG: en_US.UTF-8 run: | + export LANG + + # Function to wrap emojis in a tag + function wrapEmoji() { + emoji="\U1f300-\U1f5ff\U1f900-\U1f9ff\U1f600-\U1f64f\U1f680-\U1f6ff\U2600-\U26ff\U2700-\U27bf\U1f1e6-\U1f1ff\U1f191-\U1f251\U1f004\U1f0cf\U1f170-\U1f171\U1f17e-\U1f17f\U1f18e\U3030\U2b50\U2b55\U2934-\U2935\U2b05-\U2b07\U2b1b-\U2b1c\U3297\U3299\U303d\U00a9\U00ae\U2122\U23f3\U24c2\U23e9-\U23ef\U25b6\U23f8-\U23fa" + sed -e "s/\([$(printf $emoji)]\)/\1<\/span>/g" <<<"$*" + } # Pull the name from the README name="${{ steps.readme.outputs.name }}" @@ -89,13 +98,10 @@ jobs: desc="${desc/.*}" fi - # Emoji characters (UTF8) - emoji="\U1f300-\U1f5ff\U1f900-\U1f9ff\U1f600-\U1f64f\U1f680-\U1f6ff\U2600-\U26ff\U2700-\U27bf\U1f1e6-\U1f1ff\U1f191-\U1f251\U1f004\U1f0cf\U1f170-\U1f171\U1f17e-\U1f17f\U1f18e\U3030\U2b50\U2b55\U2934-\U2935\U2b05-\U2b07\U2b1b-\U2b1c\U3297\U3299\U303d\U00a9\U00ae\U2122\U23f3\U24c2\U23e9-\U23ef\U25b6\U23f8-\U23fa" - - echo "name=${name}" >> $GITHUB_OUTPUT - echo "type=${type}" >> $GITHUB_OUTPUT + echo "type=$(wrapEmoji ${type})" >> $GITHUB_OUTPUT + echo "name=$(wrapEmoji ${name})" >> $GITHUB_OUTPUT + echo "desc=$(wrapEmoji ${desc})" >> $GITHUB_OUTPUT echo "output=${output}" >> $GITHUB_OUTPUT - echo "desc=${desc}" | LANG=en_US.UTF-8 sed -e "s/\([$(printf $emoji)]\)/\1<\/span>/g" >> $GITHUB_OUTPUT cat ${GITHUB_OUTPUT}