Skip to content

Commit

Permalink
chore: should not trigger lark noti if sender is a project member
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyutaotao committed Apr 22, 2024
1 parent bfd9ce0 commit e9cf408
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/issue-pr-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e9cf408

Please sign in to comment.