mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 07:25:43 +08:00
fix(action): use the correct working directory (#5)
This commit is contained in:
@@ -4,23 +4,26 @@ set -uxo pipefail
|
|||||||
# Avoid file expansion when passing parameters like with '*'
|
# Avoid file expansion when passing parameters like with '*'
|
||||||
set -o noglob
|
set -o noglob
|
||||||
|
|
||||||
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
|
# Set up working directory
|
||||||
|
WORKDIR="app"
|
||||||
|
cp -r . /tmp/gitdir
|
||||||
|
mv /tmp/gitdir "$WORKDIR"
|
||||||
|
cd "$WORKDIR" || exit
|
||||||
|
|
||||||
# Create the output directory
|
# Create the output directory
|
||||||
|
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
|
||||||
mkdir -p "$(dirname $OUTPUT)"
|
mkdir -p "$(dirname $OUTPUT)"
|
||||||
|
|
||||||
# Separate arguments before passing them to git-cliff command
|
# Separate arguments before passing them to git-cliff command
|
||||||
args=$(echo "$@" | xargs)
|
args=$(echo "$@" | xargs)
|
||||||
|
|
||||||
# Execute git-cliff
|
# Execute git-cliff
|
||||||
mkdir app
|
GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args
|
||||||
cp -r .git app
|
|
||||||
cd app
|
|
||||||
GIT_CLIFF_OUTPUT="../$OUTPUT" git-cliff $args
|
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
# Output to console
|
# Output to console
|
||||||
cat "$OUTPUT"
|
cat "$OUTPUT"
|
||||||
|
OUTPUT="$WORKDIR/$OUTPUT"
|
||||||
|
|
||||||
# Set output file
|
# Set output file
|
||||||
echo "::set-output name=changelog::$OUTPUT"
|
echo "::set-output name=changelog::$OUTPUT"
|
||||||
|
|||||||
Reference in New Issue
Block a user