1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-02-01 17:51:49 +00:00

fix reapproval

This commit is contained in:
CanbiZ 2025-01-24 14:06:03 +01:00 committed by GitHub
parent 8c6af4db1f
commit 1c90c131b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,9 +70,20 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the PR number for the current branch
PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number')
PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then
gh pr review "$PR_NUMBER" --approve
# Check if a PR number was retrieved
if [ -n "$PR_NUMBER" ]; then
# Get the PR author
PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
# Approve the PR if it was not created by the bot
if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then
gh pr review "$PR_NUMBER" --approve
else
echo "PR was created by the bot, skipping review."
fi
else
echo "PR was created by the bot, skipping review."
echo "No PR found for the current branch."
fi