Skip to content

Commit f23da27

Browse files
authored
Update auto-update-app-headers.yml
1 parent 1c008a1 commit f23da27

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

.github/workflows/auto-update-app-headers.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Git
2626
run: |
2727
git config --global user.name "GitHub Actions"
28-
git config --global user.email "actions@github.com"
28+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
2929
3030
# Step 3: Install figlet
3131
- name: Install figlet
@@ -55,17 +55,13 @@ jobs:
5555
- name: Commit and create PR if changes exist
5656
if: steps.verify-diff.outputs.changed == 'true'
5757
run: |
58-
git config --global user.name "github-actions[bot]"
59-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
60-
git add ./ct/*.app
58+
git add -A
6159
git commit -m "Update .app files"
62-
# Create a temporary branch for the PR
6360
git checkout -b pr-update-app-files
6461
git push origin pr-update-app-files --force
6562
66-
# Create PR against main
6763
gh pr create --title "[core] update .app files" \
68-
--body "This PR is auto-generated by a Github Action to update the .app files." \
64+
--body "This PR is auto-generated by a GitHub Action to update the .app files." \
6965
--head pr-update-app-files \
7066
--base main \
7167
--label "automated pr"
@@ -77,21 +73,15 @@ jobs:
7773
if: steps.verify-diff.outputs.changed == 'false'
7874
run: echo "No changes to commit. Workflow completed successfully."
7975

80-
76+
# Step 8: Re-approve pull request after update
8177
- name: Re-approve pull request after update
8278
if: steps.verify-diff.outputs.changed == 'true'
8379
env:
8480
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8581
run: |
86-
# Get the PR number for the current branch
8782
PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number')
88-
89-
# Check if a PR number was retrieved
9083
if [ -n "$PR_NUMBER" ]; then
91-
# Get the PR author
9284
PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
93-
94-
# Approve the PR if it was not created by the bot
9585
if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then
9686
gh pr review "$PR_NUMBER" --approve
9787
else

0 commit comments

Comments
 (0)