File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- name : Devtron-auto-labeller
1+ name : Devtron-auto-labeler
22
33on :
44 issue_comment :
@@ -25,11 +25,11 @@ jobs:
2525 ISSUE_NUMBER=$(jq -r '.issue.number // .pull_request.number' "$GITHUB_EVENT_PATH")
2626 COMMENT_AUTHOR=$(jq -r '.comment.user.login' "$GITHUB_EVENT_PATH")
2727
28- ORG_NAME="satyam-tests "
28+ ORG_NAME="devtron-labs "
2929
3030 # Check if the person is authorized to add labels
31- curl -s -H "Authorization: token $GH_TOKEN" "https://api.github.com/orgs/$ORG_NAME/members/$COMMENT_AUTHOR" > /dev/null
32- if [[ $? -ne 0 ]]; then
31+ RESPONSE=$( curl -s -o /dev/null -w "%{http_code}" - H "Authorization: token $GH_TOKEN" "https://api.github.com/orgs/$ORG_NAME/members/$COMMENT_AUTHOR")
32+ if [[ "$RESPONSE" -ne 204 ]]; then
3333 gh issue comment "$ISSUE_NUMBER" --body "Hi @$COMMENT_AUTHOR, you must be a member of the organization '$ORG_NAME' to add or remove labels."
3434 echo "User '$COMMENT_AUTHOR' is not a member of the organization '$ORG_NAME'. Exiting."
3535 exit 1
5353 fi
5454 fi
5555
56- # Remove Label Logic
56+ # Removes Label Logic
5757 if [[ "$COMMENT_BODY" =~ ^/remove[[:space:]](.+)$ ]]; then
5858 LABEL_NAME_TO_REMOVE=$(echo "$COMMENT_BODY" | sed -n 's|/remove ||p')
5959
6464 else
6565 echo "The label '$LABEL_NAME_TO_REMOVE' is not attached to issue #$ISSUE_NUMBER."
6666 fi
67- fi
67+ fi
You can’t perform that action at this time.
0 commit comments