File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5+ GITHUB_OUTPUT=${GITHUB_OUTPUT:- }
6+
57if [[ $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
1921if [[ -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;
2431fi
2532
2633echo " ::debug::Calculating diff..."
2734PART=$( 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
You can’t perform that action at this time.
0 commit comments