Skip to content

Commit

Permalink
Merge pull request #88 from tj-actions/feat/fix-deprecation-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jan 10, 2023
2 parents 5764b18 + 1004e55 commit 64351d8
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

GITHUB_OUTPUT=${GITHUB_OUTPUT:-}

if [[ $GITHUB_REF != "refs/tags/"* ]]; then
echo "::warning::Skipping: This should only run on tags push or on release instead of '$GITHUB_EVENT_NAME'.";
exit 0;
Expand All @@ -19,13 +21,26 @@ CURRENT_TAG=${3:-$(git tag -l --sort=-version:refname "$MAJOR_VERSION.*" | grep
if [[ -z $CURRENT_TAG ]]; then
echo "::warning::Initial release detected unable to determine any tag diff."
echo "::warning::Setting release_type to $INPUT_INITIAL_RELEASE_TYPE."
echo "::set-output name=release_type::$INPUT_INITIAL_RELEASE_TYPE"

if [[ -z "$GITHUB_OUTPUT" ]]; then
echo "::set-output name=release_type::$INPUT_INITIAL_RELEASE_TYPE"
else
echo "release_type=$INPUT_INITIAL_RELEASE_TYPE" >> "$GITHUB_OUTPUT"
fi
exit 0;
fi

echo "::debug::Calculating diff..."
PART=$(wget -O - https://raw.githubusercontent.com/fsaintjacques/semver-tool/3.3.0/src/semver | bash -s diff "${CURRENT_TAG//v/}" "${NEW_TAG//v/}")

echo "::set-output name=release_type::$PART"
echo "::set-output name=old_version::$CURRENT_TAG"
echo "::set-output name=new_version::$NEW_TAG"
if [[ -z "$GITHUB_OUTPUT" ]]; then
echo "::set-output name=release_type::$PART"
echo "::set-output name=old_version::$CURRENT_TAG"
echo "::set-output name=new_version::$NEW_TAG"
else
cat <<EOF >> "$GITHUB_OUTPUT"
release_type=$PART
old_version=$CURRENT_TAG
new_version=$NEW_TAG
EOF
fi

0 comments on commit 64351d8

Please sign in to comment.