From 481138bff510e56e885bc30d57eee9a4d1b7a7e5 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:05:14 +0100 Subject: [PATCH] Update auto-update-app-headers.yml --- .github/workflows/auto-update-app-headers.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-update-app-headers.yml b/.github/workflows/auto-update-app-headers.yml index 5df67fbd..c3b73bc3 100644 --- a/.github/workflows/auto-update-app-headers.yml +++ b/.github/workflows/auto-update-app-headers.yml @@ -58,7 +58,7 @@ jobs: git push origin pr-update-app-headers --force # Create PR against main - gh pr create --title "[Github Action] Update .app-headers file" \ + gh pr create --title "[core] update .app-headers file" \ --body "This PR is auto-generated by a Github Action to update the .app-headers file." \ --head pr-update-app-headers \ --base main \ @@ -66,12 +66,17 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Approve pull request + - name: Re-approve pull request after update if: steps.verify-diff.outputs.changed == 'true' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | PR_NUMBER=$(gh pr list --head "pr-update-app-headers" --json number --jq '.[].number') - if [ -n "$PR_NUMBER" ]; then - gh pr review $PR_NUMBER --approve + # Check if the PR was created by the bot (skip review if so) + 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 + else + echo "PR was created by the bot, skipping review." fi +