Skip to content

Commit 647fb1c

Browse files
authored
Update auto-update-app-headers.yml
1 parent 45916ed commit 647fb1c

File tree

1 file changed

+16
-27
lines changed

1 file changed

+16
-27
lines changed

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

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
paths:
88
- 'ct/**.sh'
9-
workflow_dispatch: # Ermöglicht das manuelle Ausführen der Action
9+
workflow_dispatch:
1010

1111
jobs:
1212
update-app-headers:
@@ -23,20 +23,7 @@ jobs:
2323
git config --global user.name "GitHub Actions"
2424
git config --global user.email "[email protected]"
2525
26-
# Step 3: Create a new branch from main
27-
- name: Create a new branch based on main
28-
run: |
29-
git fetch origin
30-
git checkout main
31-
git pull origin main
32-
33-
# Feste Branch-Name für Debugging
34-
BRANCH_NAME="update-app-headers-branch"
35-
echo "Branch name: $BRANCH_NAME" # Debugging
36-
37-
git checkout -b "$BRANCH_NAME"
38-
echo "Created and switched to branch $BRANCH_NAME"
39-
26+
# Step 3: Install figlet
4027
- name: Install figlet
4128
run: sudo apt-get install -y figlet
4229

@@ -48,18 +35,20 @@ jobs:
4835
env:
4936
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5037

51-
# Step 5: Push changes to the new branch
52-
- name: Push changes to the new branch
38+
# Step 5: Commit the changes directly to main (no temporary branch)
39+
- name: Commit changes directly to main
5340
run: |
54-
echo "Pushing changes to branch $BRANCH_NAME" # Debugging
5541
git add ./misc/.app-headers
5642
git commit -m "Update .app-headers file"
57-
git push origin "$BRANCH_NAME"
58-
59-
# Step 6: Delete the created branch locally and remotely after push
60-
- name: Delete the branch after push
61-
run: |
62-
git push origin --delete "$BRANCH_NAME" # Delete remote branch
63-
git checkout main
64-
git branch -D "$BRANCH_NAME" # Delete local branch
65-
echo "Branch $BRANCH_NAME deleted."
43+
git push origin main
44+
45+
# Step 6: Create Pull Request (PR) to main
46+
- name: Create Pull Request to main
47+
uses: peter-evans/create-pull-request@v3
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
base: main
51+
head: main # Direkt gegen den main Branch
52+
title: "Update .app-headers file"
53+
body: "Automated PR to update .app-headers file based on script changes."
54+
draft: false # Setze auf true, wenn der PR als Draft erstellt werden soll

0 commit comments

Comments
 (0)