From e9cf408330e87e24f7bbbc2a58b90e87437aead2 Mon Sep 17 00:00:00 2001 From: yutao Date: Mon, 22 Apr 2024 22:37:38 +0800 Subject: [PATCH] chore: should not trigger lark noti if sender is a project member --- .github/workflows/issue-pr-trigger.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/issue-pr-trigger.yml b/.github/workflows/issue-pr-trigger.yml index 2ae151b8d5de..3b56d736c2de 100644 --- a/.github/workflows/issue-pr-trigger.yml +++ b/.github/workflows/issue-pr-trigger.yml @@ -23,18 +23,14 @@ jobs: run: | SENDER=${{ github.event.sender.login }} RESPONSE=$(gh api /orgs/$REPO_OWNER/members/$SENDER --include 2>&1) - + echo "$RESPONSE" STATUS_CODE=$(echo "$RESPONSE" | grep HTTP | head -n 1 | awk '{print $2}') - + if [[ "$STATUS_CODE" == "204" ]]; then echo "::set-output name=skip::true" echo "Workflow triggered by a project member: $SENDER , will NOT trigger lark notify" - elif [[ "$STATUS_CODE" == "404" ]]; then - echo "::set-output name=skip::false" else - # 如果返回其他状态码,则可能需要进一步处理或报错 - echo "Unhandled response status code: $STATUS_CODE" - exit 1 + echo "::set-output name=skip::false" fi - name: Notify Lark for Issue if: steps.check_member.outputs.skip != 'true' && github.event_name == 'issues'