Files
git-cliff-action/entrypoint.sh
Matteo Ferrando 4d60dd0dbe fix(args): handle quotes in passed args (#3)
* add ' to test

* separate git cliff args before passing

* file expansion
2022-11-19 20:20:33 +01:00

27 lines
560 B
Bash
Executable File

#!/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 $args
exit_code=$?
# Output to console
cat "$OUTPUT"
# Set output file
echo "::set-output name=changelog::$OUTPUT"
# Pass exit code to the next step
echo "::set-output name=exit_code::$exit_code"