From 4ebfe28af09f09cc21ce0c517545faf5cd596b03 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Thu, 25 Jun 2020 20:18:20 +0200 Subject: [PATCH 1/5] Add skip_dirty_check option --- action.yml | 4 ++++ entrypoint.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 254503a..473689c 100644 --- a/action.yml +++ b/action.yml @@ -43,6 +43,10 @@ inputs: description: Push options (eg. --force) required: false default: '' + skip_dirty_check: + description: Skip the check if the git repository is dirty and always try to create a commit. + required: false + default: false outputs: changes_detected: diff --git a/entrypoint.sh b/entrypoint.sh index aeab256..1c1b6f5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu _main() { _switch_to_repository - if _git_is_dirty; then + if _git_is_dirty || [ -n "$INPUT_SKIP_DIRTY_CHECK" ]; then echo "::set-output name=changes_detected::true"; From 49e28abb3fdf4552230e4079ca389973c3c6a004 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Thu, 25 Jun 2020 20:31:48 +0200 Subject: [PATCH 2/5] WIP --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1c1b6f5..17a553b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu _main() { _switch_to_repository - if _git_is_dirty || [ -n "$INPUT_SKIP_DIRTY_CHECK" ]; then + if _git_is_dirty -o [ "$INPUT_SKIP_DIRTY_CHECK" = true ]; then echo "::set-output name=changes_detected::true"; From 41835949327062fd9ba4712c02f7ce475a14b015 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Thu, 25 Jun 2020 20:38:28 +0200 Subject: [PATCH 3/5] WIP --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 17a553b..8a8b0d8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu _main() { _switch_to_repository - if _git_is_dirty -o [ "$INPUT_SKIP_DIRTY_CHECK" = true ]; then + if _git_is_dirty || [ "$INPUT_SKIP_DIRTY_CHECK" = true ]; then echo "::set-output name=changes_detected::true"; From f120678ed1b06752ca97fd70a5cf3ab93a5a4d69 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Thu, 25 Jun 2020 20:40:31 +0200 Subject: [PATCH 4/5] WIP --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8a8b0d8..78a8d72 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu _main() { _switch_to_repository - if _git_is_dirty || [ "$INPUT_SKIP_DIRTY_CHECK" = true ]; then + if _git_is_dirty || [ "$INPUT_SKIP_DIRTY_CHECK" = true ]; then echo "::set-output name=changes_detected::true"; From c8ded2885e7f3b72df92f2c37da724701cc09d4e Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Fri, 26 Jun 2020 21:00:48 +0200 Subject: [PATCH 5/5] Simplify IF Condition --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 78a8d72..1fe4d4d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,7 @@ set -eu _main() { _switch_to_repository - if _git_is_dirty || [ "$INPUT_SKIP_DIRTY_CHECK" = true ]; then + if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then echo "::set-output name=changes_detected::true";