From 3b083ef5f790388bf6b10e140a28d12d6374c171 Mon Sep 17 00:00:00 2001 From: Andy Augustin Date: Fri, 7 Oct 2022 20:41:24 +0200 Subject: [PATCH] fix(): fix issue with empty ignore file (#211) :bug: --- .github/workflows/push_docker.yml | 2 ++ src/sync_template.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_docker.yml b/.github/workflows/push_docker.yml index 96a4a710..6c35c105 100644 --- a/.github/workflows/push_docker.yml +++ b/.github/workflows/push_docker.yml @@ -7,6 +7,8 @@ on: push: branches: - main + tags: + - 'v*' paths-ignore: - '**/*.md' diff --git a/src/sync_template.sh b/src/sync_template.sh index a898f74f..10e97467 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -60,7 +60,9 @@ echo "::endgroup::" echo "::group::commit and push changes" git add . -if [ -r ${TEMPLATE_SYNC_IGNORE_FILE_NAME} ] +# we are checking the ignore file if it exists or is empty +# -s is true if the file contains whitespaces +if [ -s ${TEMPLATE_SYNC_IGNORE_FILE_NAME} ] then echo "::debug::unstage files from template sync ignore" git reset --pathspec-from-file="${TEMPLATE_SYNC_IGNORE_FILE_NAME}"