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 23, 2024
1 parent 70afb94 commit d31e9b6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/issue-pr-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
SENDER=${{ github.event.sender.login }}
gh --version
API_ENDPOINT="https://api.github.com/orgs/$REPO_OWNER/members/$SENDER"
AUTH_HEADER="Authorization: token $GH_TOKEN"
HTTP_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "$AUTH_HEADER" "$API_ENDPOINT")
echo "HTTP response status: $HTTP_RESPONSE"
# gh --version
# gh api /orgs/$REPO_OWNER/members/$SENDER
STATUS=$?
echo "Status: $STATUS"
# STATUS=$?
# echo "Status: $STATUS"
if [ $STATUS -eq 0 ]; then
# if [ $STATUS -eq 0 ]; then
if [ "$HTTP_RESPONSE" -eq 204 ]; then
echo "::set-output name=skip::true"
echo "Workflow triggered by a project member: $SENDER , will NOT trigger lark notify"
else
echo "::set-output name=skip::false"
fi
exit 0
- name: Notify Lark for Issue
if: steps.check_member.outputs.skip != 'true' && github.event_name == 'issues'
env:
Expand Down

0 comments on commit d31e9b6

Please sign in to comment.