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