mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-24 08:25:45 +08:00
refactor(action): use OUTPUT environment variable as output path
This commit is contained in:
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -17,5 +17,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
config: fixtures/cliff.toml
|
config: fixtures/cliff.toml
|
||||||
args: --verbose
|
args: --verbose
|
||||||
|
env:
|
||||||
|
OUTPUT: fixtures/CHANGELOG.md
|
||||||
- name: Print the changelog
|
- name: Print the changelog
|
||||||
run: echo "${{ steps.git-cliff.outputs.changelog }}"
|
run: cat "${{ steps.git-cliff.outputs.changelog }}"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ inputs:
|
|||||||
default: "-v"
|
default: "-v"
|
||||||
outputs:
|
outputs:
|
||||||
changelog:
|
changelog:
|
||||||
description: "generated changelog"
|
description: "output file"
|
||||||
runs:
|
runs:
|
||||||
using: "docker"
|
using: "docker"
|
||||||
image: "Dockerfile"
|
image: "Dockerfile"
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
#!/bin/bash -l
|
#!/bin/bash -l
|
||||||
set -uxo pipefail
|
set -uxo pipefail
|
||||||
|
|
||||||
CHANGELOG_OUT=${CHANGELOG_OUT:="git-cliff/CHANGELOG.md"}
|
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
|
||||||
|
|
||||||
# Create the output directory
|
# Create the output directory
|
||||||
mkdir -p "$(dirname $CHANGELOG_OUT)"
|
mkdir -p "$(dirname $OUTPUT)"
|
||||||
|
|
||||||
# Execute git-cliff
|
# Execute git-cliff
|
||||||
git-cliff "$@" > "$CHANGELOG_OUT"
|
git-cliff "$@" > "$OUTPUT"
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
|
||||||
# Output to console
|
# Output to console
|
||||||
cat "$CHANGELOG_OUT"
|
cat "$OUTPUT"
|
||||||
echo
|
|
||||||
|
|
||||||
# Set output
|
# Set output file
|
||||||
echo "::set-output name=changelog::$CHANGELOG_OUT"
|
echo "::set-output name=changelog::$OUTPUT"
|
||||||
|
|
||||||
# Pass exit code to the next step
|
# Pass exit code to the next step
|
||||||
echo "::set-output name=exit_code::$exit_code"
|
echo "::set-output name=exit_code::$exit_code"
|
||||||
|
|||||||
Reference in New Issue
Block a user