From b95829e081e8174b73024a39a60c81e7a070a1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Wed, 23 Nov 2022 12:28:21 +0300 Subject: [PATCH] fix(action): use the correct working directory (#5) --- entrypoint.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 85d4d1a..a550ff7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,23 +4,26 @@ set -uxo pipefail # Avoid file expansion when passing parameters like with '*' 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 +OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"} mkdir -p "$(dirname $OUTPUT)" # Separate arguments before passing them to git-cliff command args=$(echo "$@" | xargs) # Execute git-cliff -mkdir app -cp -r .git app -cd app -GIT_CLIFF_OUTPUT="../$OUTPUT" git-cliff $args +GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args exit_code=$? # Output to console cat "$OUTPUT" +OUTPUT="$WORKDIR/$OUTPUT" # Set output file echo "::set-output name=changelog::$OUTPUT"