mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-01 14:51:50 +00:00
Update auto-update-app-headers.yml
This commit is contained in:
parent
1c008a1742
commit
f23da27ba2
18
.github/workflows/auto-update-app-headers.yml
vendored
18
.github/workflows/auto-update-app-headers.yml
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user