From a803f63cc4f499e7858e0c45e3afa00742d72a1a Mon Sep 17 00:00:00 2001 From: LIRUI <298977887@qq.com> Date: Mon, 28 Oct 2024 18:53:38 +0800 Subject: [PATCH] 1028.5 --- .github/workflows/CCC.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CCC.yml b/.github/workflows/CCC.yml index 2673d3c..d2b8f38 100644 --- a/.github/workflows/CCC.yml +++ b/.github/workflows/CCC.yml @@ -137,11 +137,12 @@ jobs: LUCI_BRANCH=$(git rev-parse --abbrev-ref HEAD) LUCI_COMMIT=$(git rev-parse --short HEAD) - # 格式化 LuCI 版本信息,适应 URL 编码的格式 + # 格式化 LuCI 版本信息,将空格替换为下划线,并构建为目标格式 LUCI_VERSION="LuCI_${LUCI_BRANCH}_branch_(git--${LUCI_COMMIT})" - LUCI_VERSION_ENCODED=$(echo $LUCI_VERSION | sed 's/ /_/g; s/(/%28/g; s/)/%29/g; s/-/%2D/g') - echo "LUCI_VERSION_ENCODED=$LUCI_VERSION_ENCODED" >> $GITHUB_ENV - echo "LuCI 版本信息:$LUCI_VERSION_ENCODED" + # 替换字符,以确保徽章 URL 正确 + LUCI_VERSION_FORMATTED=$(echo "$LUCI_VERSION" | sed 's/ /_/g; s/-/--/g') + echo "LUCI_VERSION_FORMATTED=$LUCI_VERSION_FORMATTED" >> $GITHUB_ENV + echo "LuCI 版本信息:$LUCI_VERSION_FORMATTED" # 更新 README.md 文件 - name: ✏️ 更新 README.md 文件 @@ -157,7 +158,7 @@ jobs: KERNEL_VERSION="${FULL_KERNEL_VERSION}" DISTRIB_REVISION="${{ env.distrib_revision }}" #LuCI 版本 - LUCI_VERSION="${LUCI_VERSION_ENCODED}" + LUCI_VERSION="${LUCI_VERSION_FORMATTED}" NEW_CONTENT="\n\n" NEW_CONTENT+="![Latest Version](https://img.shields.io/badge/固件版本-${DISTRIB_REVISION}-brightgreen)\n"