Skip to content

Commit

Permalink
Merge pull request #24 from kerthcet/feat/remove-kind
Browse files Browse the repository at this point in the history
trim \n
  • Loading branch information
InftyAI-Agent authored Jun 23, 2024
2 parents 380e897 + b27020f commit 0f3c48f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/kube-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
COMMENT_USER=$(jq -r '.comment.user.login' $GITHUB_EVENT_PATH)
while IFS= read -r COMMENT_LINE; do
COMMENT_LINE=$(echo "$COMMENT_LINE" | sed ':a;N;$!ba;s/\n//g' | awk '{$1=$1};1')
COMMENT_LINE=$(echo "$COMMENT_LINE" | awk '{$1=$1};1')
COMMENT_LINE=$(echo "$COMMENT_LINE" | tr -d '\n')
if [[ "$COMMENT_LINE" == "/lgtm" ]]; then
gh pr edit $PR_NUMBER --add-label lgtm
Expand All @@ -42,6 +43,7 @@ jobs:
gh pr edit $PR_NUMBER --add-label approved
echo "Add label: approved"
else
gh pr comment $PR_NUMBER --body "User @$COMMENT_USER is not authorized to approve this PR."
echo "User $COMMENT_USER is not authorized to approve"
fi
elif [[ "$COMMENT_LINE" == "/lgtm cancel" ]]; then
Expand All @@ -57,7 +59,8 @@ jobs:
gh pr edit $PR_NUMBER --remove-label approved
echo "Remove label: approved"
else
echo "User $COMMENT_USER is not authorized to cancel the approved label"
gh pr comment $PR_NUMBER --body "User @$COMMENT_USER is not authorized to cancel the approval."
echo "User $COMMENT_USER is not authorized to cancel the approval"
fi
else
echo "Label 'approved' does not exist"
Expand Down

0 comments on commit 0f3c48f

Please sign in to comment.