Update auto-update-app-headers.yml

This commit is contained in:
CanbiZ 2025-01-14 15:05:14 +01:00 committed by GitHub
parent c032db98a3
commit 481138bff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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