fix(action): put git-cliff binary inside ./bin (#30)

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
This commit is contained in:
Ludovic Ortega
2024-09-02 14:07:20 +02:00
committed by GitHub
parent 8720f565e1
commit 01a5c9a9d1
2 changed files with 6 additions and 3 deletions

View File

@@ -33,9 +33,12 @@ LOCATION="$(echo "${RELEASE_INFO}" \
| jq --raw-output ".assets[].browser_download_url" \
| grep "${TARGET}$")"
# Create bin directory
mkdir -p ./bin
# Skip downloading release if downloaded already, e.g. when the action is used multiple times.
if [[ ! -e "$TARGET" ]]; then
curl --silent --show-error --fail --location --output "$TARGET" "$LOCATION"
tar -xf "$TARGET"
mv git-cliff-${TAG_NAME:1}/git-cliff .
mv git-cliff-${TAG_NAME:1}/git-cliff ./bin/git-cliff
fi

4
run.sh
View File

@@ -17,12 +17,12 @@ mkdir -p "$(dirname $OUTPUT)"
args=$(echo "$@" | xargs)
# Execute git-cliff
GIT_CLIFF_OUTPUT="$OUTPUT" ./git-cliff $args
GIT_CLIFF_OUTPUT="$OUTPUT" ./bin/git-cliff $args
exit_code=$?
# Retrieve context
CONTEXT="$(mktemp)"
GIT_CLIFF_OUTPUT="$CONTEXT" ./git-cliff $args --context
GIT_CLIFF_OUTPUT="$CONTEXT" ./bin/git-cliff $args --context
# Output to console
cat "$OUTPUT"