From d852e7b09832030d53fae6f10914632dcc1fbfa2 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:13:05 +0100 Subject: [PATCH] Update auto-update-app-headers.yml --- .github/workflows/auto-update-app-headers.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-app-headers.yml b/.github/workflows/auto-update-app-headers.yml index 79a92c7e8..5d67131c3 100644 --- a/.github/workflows/auto-update-app-headers.yml +++ b/.github/workflows/auto-update-app-headers.yml @@ -80,13 +80,20 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number') + if [ -n "$PR_NUMBER" ]; then PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login') + + # Skip approval if the PR was 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." + echo "Skipping approval: PR was created by the bot." fi else echo "No PR found for the current branch." fi + + else + echo "No PR found for the current branch." + fi