From c0d546fb9da848046f8d6928bcda59ce1baf047a Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Mon, 16 Jun 2025 15:03:06 -0500 Subject: [PATCH] Auto merge Fehler repariert. --- .github/workflows/auto-merge-staging-into-main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-merge-staging-into-main.yml b/.github/workflows/auto-merge-staging-into-main.yml index 94c07dd5..848cde2e 100644 --- a/.github/workflows/auto-merge-staging-into-main.yml +++ b/.github/workflows/auto-merge-staging-into-main.yml @@ -8,6 +8,8 @@ on: jobs: merge: runs-on: ubuntu-latest + outputs: + reason: ${{ steps.check.outputs.reason }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -28,9 +30,15 @@ jobs: id: check run: | git fetch origin - if [ $(git rev-list --count origin/staging..origin/main) -gt 0 ]; then + COUNT=$(git rev-list --count origin/staging..origin/main) + if [ "$COUNT" -gt 0 ]; then + echo "reason=ok" >> $GITHUB_OUTPUT echo "❌ Staging is behind main and requires manual merging." exit 1 + elif [ "$COUNT" -eq 0 ]; then + echo "reason=identical" >> $GITHUB_OUTPUT + echo "✅ Staging and main are identical. Nothing to do." + exit 42 fi - name: Create PR from staging to main @@ -53,7 +61,7 @@ jobs: notify_failure: needs: merge - if: failure() + if: failure() && needs.merge.outputs.reason != 'identical' runs-on: ubuntu-latest steps: - name: Send Discord notification on failure