Skip to content

Commit

Permalink
Swapped from set-output to $GITHUB_OUTPUT (#4)
Browse files Browse the repository at this point in the history
Swapped from echo "::set-output name={name}::{value}" to echo "{name}={value}" >> $GITHUB_OUTPUT
  • Loading branch information
Skenvy authored Nov 6, 2022
1 parent 8531021 commit d2eb655
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ MAIN=$(git rev-parse $MAIN_BRANCH)
PREVIOUS_MAIN=$(git rev-parse $MAIN^1)
SHA_DIFF="$PREVIOUS_MAIN..$HEAD"
echo "::notice::The 'previous main'..'current_head' diff is $SHA_DIFF"
echo "::set-output name=diff_from::$PREVIOUS_MAIN"
echo "::set-output name=diff_to::$HEAD"
echo "diff_from=$PREVIOUS_MAIN" >> $GITHUB_OUTPUT
echo "diff_to=$HEAD" >> $GITHUB_OUTPUT
set +u
PROJECT_DIFF=$(git diff $SHA_DIFF $PROJECT_FILE)
[ "$PROJECT_DIFF" == "" ] && echo "::warning::The diff $SHA_DIFF has no lines in $PROJECT_FILE, so ending the action." && exit 0
Expand All @@ -53,18 +53,18 @@ set +o pipefail
OLD_VERSION="$(echo "$PROJECT_DIFF" | grep -e "^-version = " | cut -d \" -f 2)"
if [ "$OLD_VERSION" != "" ]; then
echo "::notice::OLD VERSION IS $OLD_VERSION"
echo "::set-output name=old_version::$OLD_VERSION"
echo "old_version=$OLD_VERSION" >> $GITHUB_OUTPUT
else
echo "::warning::The diff $SHA_DIFF has no line that matches \"^-version = \" (old version) in $PROJECT_FILE; allowing the action to continue to find a new version."
echo "::set-output name=old_version::0.0.0"
echo "old_version=0.0.0" >> $GITHUB_OUTPUT
fi
NEW_VERSION="$(echo "$PROJECT_DIFF" | grep -e "^+version = " | cut -d \" -f 2)"
if [ "$NEW_VERSION" == "" ]; then
echo "::warning::The diff $SHA_DIFF has no line that matches \"^+version = \" (new version) in $PROJECT_FILE, so ending the action."
exit 0
else
echo "::notice::NEW VERSION IS $NEW_VERSION"
echo "::set-output name=new_version::$NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
fi
set -uo pipefail

Expand Down

0 comments on commit d2eb655

Please sign in to comment.