Approve pull request only if not already approved (#883)

This commit is contained in:
Zach Borboa
2024-08-21 20:32:49 -04:00
committed by GitHub
parent 3fbd244703
commit 50bb005686
+9 -1
View File
@@ -17,7 +17,15 @@ jobs:
- name: Approve and label updates
run: |
gh pr review --approve "$PR_URL"
review_status="$(
gh pr view "$PR_URL" \
--json="reviewDecision" \
--jq=".reviewDecision"
)"
echo "Pull request review status: ${review_status}"
if [[ "${review_status}" != "APPROVED" ]]; then
gh pr review --approve "$PR_URL"
fi
gh pr edit --add-label "cleanup-no-release-required" "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}