Update auto-update-app-headers.yml

This commit is contained in:
CanbiZ 2025-01-14 14:58:23 +01:00 committed by GitHub
parent 45916edef5
commit 647fb1cb5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@ on:
- main
paths:
- 'ct/**.sh'
workflow_dispatch: # Ermöglicht das manuelle Ausführen der Action
workflow_dispatch:
jobs:
update-app-headers:
@ -23,20 +23,7 @@ jobs:
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Step 3: Create a new branch from main
- name: Create a new branch based on main
run: |
git fetch origin
git checkout main
git pull origin main
# Feste Branch-Name für Debugging
BRANCH_NAME="update-app-headers-branch"
echo "Branch name: $BRANCH_NAME" # Debugging
git checkout -b "$BRANCH_NAME"
echo "Created and switched to branch $BRANCH_NAME"
# Step 3: Install figlet
- name: Install figlet
run: sudo apt-get install -y figlet
@ -48,18 +35,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step 5: Push changes to the new branch
- name: Push changes to the new branch
# Step 5: Commit the changes directly to main (no temporary branch)
- name: Commit changes directly to main
run: |
echo "Pushing changes to branch $BRANCH_NAME" # Debugging
git add ./misc/.app-headers
git commit -m "Update .app-headers file"
git push origin "$BRANCH_NAME"
git push origin main
# Step 6: Delete the created branch locally and remotely after push
- name: Delete the branch after push
run: |
git push origin --delete "$BRANCH_NAME" # Delete remote branch
git checkout main
git branch -D "$BRANCH_NAME" # Delete local branch
echo "Branch $BRANCH_NAME deleted."
# Step 6: Create Pull Request (PR) to main
- name: Create Pull Request to main
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
head: main # Direkt gegen den main Branch
title: "Update .app-headers file"
body: "Automated PR to update .app-headers file based on script changes."
draft: false # Setze auf true, wenn der PR als Draft erstellt werden soll