fix(action): fix quote/space handling in arguments

This commit is contained in:
Orhun Parmaksız
2025-02-21 00:26:46 +03:00
parent 4a4a951bc4
commit 93805b90eb
2 changed files with 9 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
name: Action Test name: Action Test
on: [ push, pull_request ] on: [push, pull_request]
jobs: jobs:
git-cliff-action: git-cliff-action:
@@ -16,7 +16,12 @@ jobs:
uses: ./ uses: ./
with: with:
config: fixtures/cliff.toml config: fixtures/cliff.toml
args: --verbose --strip 'footer' --exclude-path '.github/**' --tag 0.0.0 args: >
--verbose
--strip 'footer'
--exclude-path '.github/**'
--tag 0.0.0
--with-commit "\'test(changelog): add a custom commit\'"
env: env:
OUTPUT: fixtures/CHANGELOG.md OUTPUT: fixtures/CHANGELOG.md
- name: Print the changelog - name: Print the changelog

4
run.sh
View File

@@ -23,12 +23,12 @@ mkdir -p "$(dirname $OUTPUT)"
args=$(echo "$@" | xargs) args=$(echo "$@" | xargs)
# Execute git-cliff # Execute git-cliff
GIT_CLIFF_OUTPUT="$OUTPUT" ./bin/${GIT_CLIFF_BIN} $args eval ./bin/${GIT_CLIFF_BIN} $args --output "$OUTPUT"
exit_code=$? exit_code=$?
# Retrieve context # Retrieve context
CONTEXT="$(mktemp)" CONTEXT="$(mktemp)"
GIT_CLIFF_OUTPUT="$CONTEXT" ./bin/${GIT_CLIFF_BIN} $args --context eval ./bin/${GIT_CLIFF_BIN} $args --context --output "$CONTEXT"
# Revert permissions # Revert permissions
chown -R "$owner" . chown -R "$owner" .