Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(action): add an output for the changelog content #4

Merged
merged 7 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions action.yml
Expand Up @@ -12,6 +12,8 @@ inputs:
outputs:
changelog:
description: "output file"
content:
description: "content of the changelog"
runs:
using: "docker"
image: "Dockerfile"
Expand Down
11 changes: 8 additions & 3 deletions entrypoint.sh
Expand Up @@ -23,10 +23,15 @@ exit_code=$?

# Output to console
cat "$OUTPUT"
OUTPUT="$WORKDIR/$OUTPUT"

# Set the changelog content
echo "content<<EOF" >> $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