mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 07:25:43 +08:00
fix(args): handle quotes in passed args (#3)
* add ' to test * separate git cliff args before passing * file expansion
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
config: fixtures/cliff.toml
|
config: fixtures/cliff.toml
|
||||||
args: --verbose --strip footer
|
args: --verbose --strip 'footer' --exclude-path '.github/**'
|
||||||
env:
|
env:
|
||||||
OUTPUT: fixtures/CHANGELOG.md
|
OUTPUT: fixtures/CHANGELOG.md
|
||||||
- name: Print the changelog
|
- name: Print the changelog
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
#!/bin/bash -l
|
#!/bin/bash -l
|
||||||
set -uxo pipefail
|
set -uxo pipefail
|
||||||
|
|
||||||
|
# Avoid file expansion when passing parameters like with '*'
|
||||||
|
set -o noglob
|
||||||
|
|
||||||
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
|
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
|
||||||
|
|
||||||
# Create the output directory
|
# Create the output directory
|
||||||
mkdir -p "$(dirname $OUTPUT)"
|
mkdir -p "$(dirname $OUTPUT)"
|
||||||
|
|
||||||
|
# Separate arguments before passing them to git-cliff command
|
||||||
|
args=$(echo "$@" | xargs)
|
||||||
|
|
||||||
# Execute git-cliff
|
# Execute git-cliff
|
||||||
GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $@
|
GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
# Output to console
|
# Output to console
|
||||||
|
|||||||
Reference in New Issue
Block a user