mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-06-29 18:47:38 +00:00
[Core] Better Creation of App Headers for next feature (#1719)
* Update Function to crawl app Headers * Update Function to crawl app Headers
This commit is contained in:
32
.github/workflows/auto-update-app-headers.yml
vendored
32
.github/workflows/auto-update-app-headers.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Auto Update .app-headers
|
||||
name: Auto Update .app-files
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -9,7 +9,7 @@ on:
|
||||
workflow_dispatch: # Ermöglicht das manuelle Ausführen der Action
|
||||
|
||||
jobs:
|
||||
update-app-headers:
|
||||
update-app-files:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
@ -31,15 +31,15 @@ jobs:
|
||||
- name: Install figlet
|
||||
run: sudo apt-get install -y figlet
|
||||
|
||||
# Step 4: Run the generate-app-headers.sh script to update .app-headers
|
||||
- name: Run generate-app-headers.sh to update .app-headers
|
||||
# Step 4: Run the updated generate-app-files.sh script
|
||||
- name: Run generate-app-files.sh
|
||||
run: |
|
||||
chmod +x .github/workflows/scripts/generate-app-headers.sh
|
||||
.github/workflows/scripts/generate-app-headers.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Step 5: Check if there are any changes
|
||||
# Step 5: Check for changes
|
||||
- name: Check if there are any changes
|
||||
id: verify-diff
|
||||
run: |
|
||||
@ -51,16 +51,15 @@ jobs:
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add ./misc/.app-headers
|
||||
git commit -m "Update .app-headers file"
|
||||
# Create a temporary branch for the PR
|
||||
git checkout -b pr-update-app-headers
|
||||
git push origin pr-update-app-headers --force
|
||||
|
||||
git add ct/*.app
|
||||
git commit -m "Update .app files"
|
||||
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-headers file" \
|
||||
--body "This PR is auto-generated by a Github Action to update the .app-headers file." \
|
||||
--head pr-update-app-headers \
|
||||
gh pr create --title "[core] update .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"
|
||||
env:
|
||||
@ -71,12 +70,9 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
PR_NUMBER=$(gh pr list --head "pr-update-app-headers" --json number --jq '.[].number')
|
||||
# Check if the PR was created by the bot (skip review if so)
|
||||
PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number')
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user