From e276c71461b35fd52da7a4d62b8a3137ca3d859e Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Mon, 28 Apr 2025 13:59:42 -0300 Subject: [PATCH] Update workflow --- .github/workflows/auto-merge-staging-into-main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-merge-staging-into-main.yml b/.github/workflows/auto-merge-staging-into-main.yml index 80ea3bde..0374e23d 100644 --- a/.github/workflows/auto-merge-staging-into-main.yml +++ b/.github/workflows/auto-merge-staging-into-main.yml @@ -2,7 +2,7 @@ name: Auto Merge Staging into Main on: schedule: - - cron: '0 2 * * *' # 2:00 UTC = 4:00 Europäische Zeit + - cron: '0 2 * * *' # 2:00 UTC = 4:00 CET workflow_dispatch: jobs: @@ -27,8 +27,9 @@ jobs: - name: Check if main has commits not in staging id: check run: | - if ! git merge-base --is-ancestor origin/staging origin/main; then - echo "Main hat neuere Commits als Staging. Merge wird abgebrochen." + git fetch origin + if [ $(git rev-list --count origin/main..origin/staging) -gt 0 ]; then + echo "❌ Staging ist hinter Main und benötigt ein Merge." exit 1 fi