Skip to content

Commit

Permalink
Use one job to avoid failures
Browse files Browse the repository at this point in the history
Signed-off-by: kerthcet <[email protected]>
  • Loading branch information
kerthcet committed Jun 23, 2024
1 parent 2b1ec52 commit a256890
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/kube-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
PR_NUMBER=$(jq -r '.issue.number' $GITHUB_EVENT_PATH)
COMMENT_USER=$(jq -r '.comment.user.login' $GITHUB_EVENT_PATH)
echo $COMMENT_BODY
while IFS= read -r COMMENT_LINE; do
COMMENT_LINE=$(echo "$COMMENT_LINE" | sed 's/^[ \t]*//;s/[ \t]*$//' | tr -d '\n' | awk '{$1=$1};1')
LABEL=$(echo "$COMMENT_LINE" | awk '{print $2}')
Expand Down Expand Up @@ -96,13 +94,7 @@ jobs:
fi
done <<< "$COMMENT_BODY"
- name: Merge PR if LGTMed and approved
env:
GH_TOKEN: ${{ secrets.AGENT_TOKEN }}
run: |
PR_NUMBER=$(jq -r '.issue.number' $GITHUB_EVENT_PATH)
LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
# Merge PR if LGTMed and approved and do not hold.
if [[ "$LABELS" == *"lgtm"* && "$LABELS" == *"approved"* && "$LABELS" != *"do-not-merge/hold"* ]]; then
gh pr merge $PR_NUMBER --merge
else
Expand Down

0 comments on commit a256890

Please sign in to comment.