File tree 1 file changed +6
-6
lines changed 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
- name : Devtron-auto-labeler
1
+ name : Devtron-auto-labeller
2
2
3
3
on :
4
4
issue_comment :
@@ -25,11 +25,11 @@ jobs:
25
25
ISSUE_NUMBER=$(jq -r '.issue.number // .pull_request.number' "$GITHUB_EVENT_PATH")
26
26
COMMENT_AUTHOR=$(jq -r '.comment.user.login' "$GITHUB_EVENT_PATH")
27
27
28
- ORG_NAME="devtron-labs "
28
+ ORG_NAME="satyam-tests "
29
29
30
30
# Check if the person is authorized to add labels
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
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
33
33
gh issue comment "$ISSUE_NUMBER" --body "Hi @$COMMENT_AUTHOR, you must be a member of the organization '$ORG_NAME' to add or remove labels."
34
34
echo "User '$COMMENT_AUTHOR' is not a member of the organization '$ORG_NAME'. Exiting."
35
35
exit 1
53
53
fi
54
54
fi
55
55
56
- # Removes Label Logic
56
+ # Remove Label Logic
57
57
if [[ "$COMMENT_BODY" =~ ^/remove[[:space:]](.+)$ ]]; then
58
58
LABEL_NAME_TO_REMOVE=$(echo "$COMMENT_BODY" | sed -n 's|/remove ||p')
59
59
64
64
else
65
65
echo "The label '$LABEL_NAME_TO_REMOVE' is not attached to issue #$ISSUE_NUMBER."
66
66
fi
67
- fi
67
+ fi
You can’t perform that action at this time.
0 commit comments