mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 07:25:43 +08:00
feat(action): add output for the latest version (#12)
* feat: output `version` of the latest release * update readme
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user