2525 git checkout main
2626 git fetch upstream
2727 #ROOT_FILES=$(grep -Ev '^\.github/|^\.git/|^[^/]+$')
28- DIFF_FILES=$(git diff --name-only upstream/main HEAD | grep -Ev '^(\.github/|\.git/|^[^/]+$)' || true)
28+ BASE=$(git merge-base HEAD upstream/main)
29+ DIFF_FILES=$(git diff --name-only $BASE upstream/main | grep -Ev '^(\.github/|\.git/|^[^/]+$)' || true)
2930 echo "DIFF_FILES: $DIFF_FILES"
3031 if [ -z "$DIFF_FILES" ]; then
3132 echo "no_relevant_changes=true" >> $GITHUB_OUTPUT
@@ -50,25 +51,26 @@ jobs:
5051 echo "✅ No merge conflicts"
5152 - name : Install GitHub CLI
5253 run : sudo apt-get install gh -y
53- - name : Commit and push merge (optional PR instead)
54+ - name : Create branch, push and open PR
5455 if : ${{ success() }}
5556 env :
56- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+ GH_TOKEN : ${{ secrets.PAT }}
5758 run : |
5859 # 🟢 Option 1: Direkt pushen (Standard)
5960 #git push origin main
6061
6162 # 🟡 Option 2: PR statt direktem Merge (kommentieren, falls gewünscht)
63+ echo $GH_TOKEN | gh auth login --with-token
6264 BRANCH="upstream-merge-$(date +%s)"
6365 git checkout -b $BRANCH
6466 git push origin $BRANCH
6567 gh pr create --title "Merge from upstream" --body "Automatisch erstellter PR" --base main --head $BRANCH
6668
6769 - name : Trigger BuildLinux workflow
68- if : false && ${{ success() }}
70+ if : ${{ false && success() }}
6971 uses : benc-uk/workflow-dispatch@v1
7072 with :
71- workflow : BuildLinux .yml
73+ workflow : LinuxBuild .yml
7274 ref : main
7375 token : ${{ secrets.GITHUB_TOKEN }}
7476
0 commit comments