From c3782008ac33bb585e136290852e302fd8a4c3fe Mon Sep 17 00:00:00 2001 From: luojiyin Date: Tue, 25 Aug 2026 15:57:42 +0800 Subject: [PATCH 1/2] fix(ci): skip Lark notification for fork pull requests --- .github/workflows/Lark-notification.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Lark-notification.yml b/.github/workflows/Lark-notification.yml index af3d023..50fe608 100644 --- a/.github/workflows/Lark-notification.yml +++ b/.github/workflows/Lark-notification.yml @@ -36,7 +36,8 @@ jobs: } >> "$GITHUB_OUTPUT" - name: Send message to Lark - if: ${{ contains(steps.message.outputs.content, ':') }} + # Fork PRs cannot access repository secrets, so skip instead of failing. + if: ${{ contains(steps.message.outputs.content, ':') && secrets.LARK_CHATBOT_HOOK_URL != '' }} uses: Open-Source-Bazaar/feishu-action@v3 with: url: ${{ secrets.LARK_CHATBOT_HOOK_URL }} From 722a3b1e366c663605ae1f09f5925907f2f5c1df Mon Sep 17 00:00:00 2001 From: luojiyin Date: Tue, 25 Aug 2026 16:04:52 +0800 Subject: [PATCH 2/2] fix(ci): reference webhook secret via env in conditional --- .github/workflows/Lark-notification.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Lark-notification.yml b/.github/workflows/Lark-notification.yml index 50fe608..2c0914d 100644 --- a/.github/workflows/Lark-notification.yml +++ b/.github/workflows/Lark-notification.yml @@ -16,6 +16,10 @@ on: jobs: send-Lark-message: runs-on: ubuntu-latest + # Secrets cannot be directly referenced in if: conditionals, so expose + # only the presence flag. The raw URL stays scoped to the action step. + env: + HAS_LARK_WEBHOOK: ${{ secrets.LARK_CHATBOT_HOOK_URL != '' }} steps: - uses: actions/checkout@v6 @@ -37,7 +41,7 @@ jobs: - name: Send message to Lark # Fork PRs cannot access repository secrets, so skip instead of failing. - if: ${{ contains(steps.message.outputs.content, ':') && secrets.LARK_CHATBOT_HOOK_URL != '' }} + if: ${{ contains(steps.message.outputs.content, ':') && env.HAS_LARK_WEBHOOK == 'true' }} uses: Open-Source-Bazaar/feishu-action@v3 with: url: ${{ secrets.LARK_CHATBOT_HOOK_URL }}