From f23da27ba2a0fefbb8e8bf97accd805f0d2481fb Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:11:39 +0100 Subject: [PATCH] Update auto-update-app-headers.yml --- .github/workflows/auto-update-app-headers.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto-update-app-headers.yml b/.github/workflows/auto-update-app-headers.yml index 3d01ec45..79a92c7e 100644 --- a/.github/workflows/auto-update-app-headers.yml +++ b/.github/workflows/auto-update-app-headers.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Git run: | git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" + git config --global user.email "github-actions[bot]@users.noreply.github.com" # Step 3: Install figlet - name: Install figlet @@ -55,17 +55,13 @@ jobs: - name: Commit and create PR if changes exist if: steps.verify-diff.outputs.changed == 'true' run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add ./ct/*.app + git add -A git commit -m "Update .app files" - # Create a temporary branch for the PR git checkout -b pr-update-app-files git push origin pr-update-app-files --force - # Create PR against main gh pr create --title "[core] update .app files" \ - --body "This PR is auto-generated by a Github Action to update the .app files." \ + --body "This PR is auto-generated by a GitHub Action to update the .app files." \ --head pr-update-app-files \ --base main \ --label "automated pr" @@ -77,21 +73,15 @@ jobs: if: steps.verify-diff.outputs.changed == 'false' run: echo "No changes to commit. Workflow completed successfully." - + # Step 8: Re-approve pull request after update - name: Re-approve pull request after update if: steps.verify-diff.outputs.changed == 'true' 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') - - # 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