From fce4751119744ca31f09e2df44edd6a5f1a119a1 Mon Sep 17 00:00:00 2001 From: Gabe <41127686+Zidious@users.noreply.github.com> Date: Mon, 20 May 2024 18:43:39 +0100 Subject: [PATCH] fix(create-release): ensure action does not fail when migrations dir is provided but no new files are found (#170) --- .github/actions/create-release-v1/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/create-release-v1/action.yml b/.github/actions/create-release-v1/action.yml index f1cad08c..3a82eb46 100644 --- a/.github/actions/create-release-v1/action.yml +++ b/.github/actions/create-release-v1/action.yml @@ -71,8 +71,8 @@ runs: echo "Repo url: $repo_url" # Only get new files added to release branch that are within the provided migrations directory and end in .sql - - new_migration_files=$(git diff --name-only --diff-filter=A origin/${{ inputs.base }}...origin/release -- "${{ inputs.migrations-dir }}" | grep -E '\.sql$') + # If the directory is provided but there are no new migration files, return an empty string + new_migration_files=$(git diff --name-only --diff-filter=A origin/${{ inputs.base }}...origin/release -- "${{ inputs.migrations-dir }}" | grep -E '\.sql$' || echo "") if [ -n "$new_migration_files" ]; then echo "## New migration files found:" >> /tmp/release-notes.txt