From 4d60dd0dbe09f44f7cecd97647d159cb63cb4070 Mon Sep 17 00:00:00 2001 From: Matteo Ferrando Date: Sat, 19 Nov 2022 15:20:33 -0400 Subject: [PATCH] fix(args): handle quotes in passed args (#3) * add ' to test * separate git cliff args before passing * file expansion --- .github/workflows/main.yml | 2 +- entrypoint.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee86b6a..1b0030b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: uses: ./ with: config: fixtures/cliff.toml - args: --verbose --strip footer + args: --verbose --strip 'footer' --exclude-path '.github/**' env: OUTPUT: fixtures/CHANGELOG.md - name: Print the changelog diff --git a/entrypoint.sh b/entrypoint.sh index b8036b3..fde33e9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,13 +1,19 @@ #!/bin/bash -l set -uxo pipefail +# Avoid file expansion when passing parameters like with '*' +set -o noglob + OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"} # Create the output directory mkdir -p "$(dirname $OUTPUT)" +# Separate arguments before passing them to git-cliff command +args=$(echo "$@" | xargs) + # Execute git-cliff -GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $@ +GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args exit_code=$? # Output to console