diff --git a/README.md b/README.md index bfa70a2..7a2345a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This action generates a changelog based on your Git history using [git-cliff](ht ### Output variables - `changelog`: Output file that contains the generated changelog. +- `content`: Content of the changelog. ### Environment variables diff --git a/action.yml b/action.yml index 37d6bf1..d3a1c12 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,8 @@ inputs: outputs: changelog: description: "output file" + content: + description: "content of the changelog" runs: using: "docker" image: "Dockerfile" diff --git a/entrypoint.sh b/entrypoint.sh index a550ff7..29b305c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,10 +23,15 @@ exit_code=$? # Output to console cat "$OUTPUT" -OUTPUT="$WORKDIR/$OUTPUT" + +# Set the changelog content +echo "content<> $GITHUB_OUTPUT +cat "$OUTPUT" >> $GITHUB_OUTPUT +echo "EOF" >> $GITHUB_OUTPUT # Set output file -echo "::set-output name=changelog::$OUTPUT" +OUTPUT="$WORKDIR/$OUTPUT" +echo "changelog=$OUTPUT" >> $GITHUB_OUTPUT # Pass exit code to the next step -echo "::set-output name=exit_code::$exit_code" +echo "exit_code=$exit_code" >> $GITHUB_OUTPUT