diff --git a/.github/workflows/issue-pr-trigger.yml b/.github/workflows/issue-pr-trigger.yml index 0ac3ae30e56f..44a0afeec3b1 100644 --- a/.github/workflows/issue-pr-trigger.yml +++ b/.github/workflows/issue-pr-trigger.yml @@ -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: