Skip to content

Commit 1004e55

Browse files
authored
feat: fix deprecation warning
1 parent 5764b18 commit 1004e55

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

entrypoint.sh

+19-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -euo pipefail
44

5+
GITHUB_OUTPUT=${GITHUB_OUTPUT:-}
6+
57
if [[ $GITHUB_REF != "refs/tags/"* ]]; then
68
echo "::warning::Skipping: This should only run on tags push or on release instead of '$GITHUB_EVENT_NAME'.";
79
exit 0;
@@ -19,13 +21,26 @@ CURRENT_TAG=${3:-$(git tag -l --sort=-version:refname "$MAJOR_VERSION.*" | grep
1921
if [[ -z $CURRENT_TAG ]]; then
2022
echo "::warning::Initial release detected unable to determine any tag diff."
2123
echo "::warning::Setting release_type to $INPUT_INITIAL_RELEASE_TYPE."
22-
echo "::set-output name=release_type::$INPUT_INITIAL_RELEASE_TYPE"
24+
25+
if [[ -z "$GITHUB_OUTPUT" ]]; then
26+
echo "::set-output name=release_type::$INPUT_INITIAL_RELEASE_TYPE"
27+
else
28+
echo "release_type=$INPUT_INITIAL_RELEASE_TYPE" >> "$GITHUB_OUTPUT"
29+
fi
2330
exit 0;
2431
fi
2532

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

29-
echo "::set-output name=release_type::$PART"
30-
echo "::set-output name=old_version::$CURRENT_TAG"
31-
echo "::set-output name=new_version::$NEW_TAG"
36+
if [[ -z "$GITHUB_OUTPUT" ]]; then
37+
echo "::set-output name=release_type::$PART"
38+
echo "::set-output name=old_version::$CURRENT_TAG"
39+
echo "::set-output name=new_version::$NEW_TAG"
40+
else
41+
cat <<EOF >> "$GITHUB_OUTPUT"
42+
release_type=$PART
43+
old_version=$CURRENT_TAG
44+
new_version=$NEW_TAG
45+
EOF
46+
fi

0 commit comments

Comments
 (0)