mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 23:45:43 +08:00
22 lines
446 B
Bash
Executable File
22 lines
446 B
Bash
Executable File
#!/bin/bash -l
|
|
set -uxo pipefail
|
|
|
|
CHANGELOG_OUT=${CHANGELOG_OUT:="git-cliff/CHANGELOG.md"}
|
|
|
|
# Create the output directory
|
|
sudo mkdir -p "$(dirname $CHANGELOG_OUT)"
|
|
|
|
# Execute git-cliff
|
|
git-cliff "$@" > "$CHANGELOG_OUT"
|
|
exit_code=$?
|
|
changelog=$(cat "$CHANGELOG_OUT")
|
|
|
|
# Output to console
|
|
echo "$changelog"
|
|
|
|
# Set output
|
|
echo "::set-output name=changelog::$changelog"
|
|
|
|
# Pass exit code to the next step
|
|
echo ::set-output name=exit_code::$exit_code
|