From bbab38d54fa32b02490d3fcf10b394ecdfd23a87 Mon Sep 17 00:00:00 2001 From: ffuqiangg Date: Fri, 15 Mar 2024 22:15:10 +0800 Subject: [PATCH] fix --- .github/workflows/N1-ImmortalWrt-18.06-K5.4.yml | 7 ++++--- .github/workflows/N1-ImmortalWrt-23.05.yml | 7 ++++--- .github/workflows/N1-LEDE.yml | 7 ++++--- .github/workflows/N1-OpenWrt-23.05.yml | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/N1-ImmortalWrt-18.06-K5.4.yml b/.github/workflows/N1-ImmortalWrt-18.06-K5.4.yml index 8071db68..21d67950 100644 --- a/.github/workflows/N1-ImmortalWrt-18.06-K5.4.yml +++ b/.github/workflows/N1-ImmortalWrt-18.06-K5.4.yml @@ -151,10 +151,11 @@ jobs: - name: Telegram notification if: github.event_name == 'repository_dispatch' run: | - firmware_num=$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | wc -l) + firmware_num="$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | sort -u | wc -l)" MSG=" *${{ env.latest_release }}* 固件编译完成 https://github.com/ffuqiangg/build\_openwrt/releases/tag/${{ env.build_date }} " - [[ ${firmware_num} == 4 ]] && curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \ - -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + if [[ "${firmware_num}" == 4 ]]; then + curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + fi diff --git a/.github/workflows/N1-ImmortalWrt-23.05.yml b/.github/workflows/N1-ImmortalWrt-23.05.yml index 6b0ffda6..1981c482 100644 --- a/.github/workflows/N1-ImmortalWrt-23.05.yml +++ b/.github/workflows/N1-ImmortalWrt-23.05.yml @@ -150,10 +150,11 @@ jobs: - name: telegram notification if: github.event_name == 'repository_dispatch' run: | - firmware_num=$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | wc -l) + firmware_num="$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | sort -u | wc -l)" MSG=" *${{ env.latest_release }}* 固件编译完成 https://github.com/ffuqiangg/build\_openwrt/releases/tag/${{ env.build_date }} " - [[ ${firmware_num} == 4 ]] && curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \ - -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + if [[ "${firmware_num}" == 4 ]]; then + curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + fi diff --git a/.github/workflows/N1-LEDE.yml b/.github/workflows/N1-LEDE.yml index 6550b02b..6027d60e 100644 --- a/.github/workflows/N1-LEDE.yml +++ b/.github/workflows/N1-LEDE.yml @@ -155,10 +155,11 @@ jobs: - name: Telegram notification if: github.event_name == 'repository_dispatch' run: | - firmware_num=$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | wc -l) + firmware_num="$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | sort -u | wc -l)" MSG=" *${{ env.latest_release }}* 固件编译完成 https://github.com/ffuqiangg/build\_openwrt/releases/tag/${{ env.build_date }} " - [[ ${firmware_num} == 4 ]] && curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \ - -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + if [[ "${firmware_num}" == 4 ]]; then + curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + fi diff --git a/.github/workflows/N1-OpenWrt-23.05.yml b/.github/workflows/N1-OpenWrt-23.05.yml index b1300632..f017a960 100644 --- a/.github/workflows/N1-OpenWrt-23.05.yml +++ b/.github/workflows/N1-OpenWrt-23.05.yml @@ -161,10 +161,11 @@ jobs: - name: telegram notification if: github.event_name == 'repository_dispatch' run: | - firmware_num=$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | wc -l) + firmware_num="$(curl -fsSL https://github.com/ffuqiangg/build_openwrt/releases/expanded_assets/${{ env.build_date }} | grep -oE "N1-.*.zip" | sort -u | wc -l)" MSG=" *${{ env.latest_release }}* 固件编译完成 https://github.com/ffuqiangg/build\_openwrt/releases/tag/${{ env.build_date }} " - [[ ${firmware_num} == 4 ]] && curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \ - -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + if [[ "${firmware_num}" == 4 ]]; then + curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}&parse_mode=MarkDown&disable_web_page_preview=true" + fi