Skip to content

Commit

Permalink
fix: add support for message output (#32)
Browse files Browse the repository at this point in the history
* fix: add support for message output

* docs: add documentation

* chore: docs update

* fix: multiline

* Update action.yml

* fix: formatting

* fix: output

* Update action.yml
  • Loading branch information
wtrocki committed Oct 9, 2023
1 parent 0511785 commit 77c3d01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ Path to root of git repository to compare (default: current working directory)

#### `semver-type`

Returns the type (patch, minor, major) of the sementic version that would be required if producing a release.
Returns the type (patch, minor, major) of the semantic version that would be required if producing a release.

#### `output`

Returns the string containing text explaining API changes. The string can be empty if no changes are present.


### Example usage

Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ outputs:
semver-type:
description: "Returns the type (patch, minor, major) of the sementic version that would be required if producing a release."
value: ${{ steps.go-apidiff.outputs.semver-type }}
output:
description: "Contains diff output information"
value: ${{ steps.go-apidiff.outputs.output }}
runs:
using: 'composite'
steps:
Expand All @@ -51,6 +54,13 @@ runs:
OUTPUT=$($GOPATH/bin/go-apidiff ${{ inputs.base-ref }} --compare-imports=${{ inputs.compare-imports }} --print-compatible=${{ inputs.print-compatible }} --repo-path=${{ inputs.repo-path }})
GOAPIDIFF_RC=$?
set -e
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "output<<$EOF"
echo "$OUTPUT"
echo "$EOF"
} >> $GITHUB_OUTPUT
if [ $GOAPIDIFF_RC -eq 0 ]; then
if [ -z "$OUTPUT" ]; then
echo "semver-type=patch" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 77c3d01

Please sign in to comment.