From 61e74c436a26eae79fc19ea02c1aff9cfb7fa97f Mon Sep 17 00:00:00 2001 From: sjoerdbeentjes <11621275+sjoerdbeentjes@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:15:46 +0200 Subject: [PATCH] Update migration detection logic in workflow --- .github/workflows/staging-migrations.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/staging-migrations.yaml b/.github/workflows/staging-migrations.yaml index 9872f08f..06f2204f 100644 --- a/.github/workflows/staging-migrations.yaml +++ b/.github/workflows/staging-migrations.yaml @@ -18,8 +18,12 @@ jobs: id: check_changes run: | if git show-ref --verify --quiet refs/remotes/origin/main; then - if git diff --name-only origin/main...HEAD | grep -q '^migrations/'; then - echo "changes=true" >> $GITHUB_ENV + if git merge-base --is-ancestor origin/main HEAD; then + if git diff --name-only origin/main...HEAD | grep -q '^migrations/'; then + echo "changes=true" >> $GITHUB_ENV + else + echo "changes=false" >> $GITHUB_ENV + fi else echo "changes=false" >> $GITHUB_ENV fi