feat(action): add output for the latest version (#12)

* feat: output `version` of the latest release

* update readme
This commit is contained in:
Nicolas Hedger
2023-11-12 23:16:39 +01:00
committed by GitHub
parent 9158b31444
commit b7913b6646
5 changed files with 15 additions and 1 deletions

View File

@@ -19,6 +19,10 @@ args=$(echo "$@" | xargs)
GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args
exit_code=$?
# Retrieve context
CONTEXT="$(mktemp)"
GIT_CLIFF_OUTPUT="$CONTEXT" git-cliff $args --context
# Output to console
cat "$OUTPUT"
@@ -33,5 +37,8 @@ echo "EOF" >>$GITHUB_OUTPUT
# Set output file
echo "changelog=$OUTPUT" >>$GITHUB_OUTPUT
# Set the version output to the version of the latest release
echo "version=$(jq -r '.[0].version' $CONTEXT)" >>$GITHUB_OUTPUT
# Pass exit code to the next step
echo "exit_code=$exit_code" >>$GITHUB_OUTPUT