Skip to content

Commit

Permalink
Merge pull request #257 from tj-actions/chore/remove-deprecated-set-o…
Browse files Browse the repository at this point in the history
…utput-call

chore: remove deprecated set-output call
  • Loading branch information
repo-ranger[bot] authored Aug 31, 2023
2 parents 8a8b766 + cac32b9 commit 7da2667
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,14 @@ if [[ $exit_status -ne 0 ]]; then
echo "::warning::Initial release detected no updates would be made to specified files."
echo "::warning::Setting new_version and old_version to $NEW_TAG."

if [[ -z "$GITHUB_OUTPUT" ]]; then
echo "::set-output name=is_initial_release::true"
echo "::set-output name=new_version::$NEW_TAG"
echo "::set-output name=old_version::$NEW_TAG"
else
cat <<EOF >> "$GITHUB_OUTPUT"
cat <<EOF >> "$GITHUB_OUTPUT"
is_initial_release=true
new_version=$NEW_TAG
old_version=$NEW_TAG
EOF
fi
exit 0;
else
if [[ -z "$GITHUB_OUTPUT" ]]; then
echo "::set-output name=is_initial_release::false"
else
echo "is_initial_release=false" >> "$GITHUB_OUTPUT"
fi
echo "is_initial_release=false" >> "$GITHUB_OUTPUT"
fi

if [[ "$INPUT_ONLY_MAJOR" == "true" ]]; then
Expand All @@ -52,35 +42,23 @@ if [[ "$INPUT_ONLY_MAJOR" == "true" ]]; then

if [[ "$NEW_MAJOR_TAG" == "$CURRENT_MAJOR_TAG" ]]; then
echo "Skipping: This will only run on major version release not '$NEW_TAG'.";
if [[ -z "$GITHUB_OUTPUT" ]]; then
echo "::set-output name=major_update::false"
echo "::set-output name=new_version::$NEW_MAJOR_TAG"
echo "::set-output name=old_version::$CURRENT_TAG"
else
cat <<EOF >> "$GITHUB_OUTPUT"
cat <<EOF >> "$GITHUB_OUTPUT"
new_version=$NEW_TAG
old_version=$CURRENT_TAG
major_update=false
EOF
fi
else
for path in $INPUT_PATHS
do
echo "Replacing major version $CURRENT_MAJOR_TAG with $NEW_MAJOR_TAG for: $path"
sed -i "s|$PATTERN$CURRENT_MAJOR_TAG\(.[[:digit:]]\)\{0,1\}\(.[[:digit:]]\)\{0,1\}|$PATTERN$NEW_MAJOR_TAG|g" "$path"
done

if [[ -z "$GITHUB_OUTPUT" ]]; then
echo "::set-output name=new_version::$NEW_MAJOR_TAG"
echo "::set-output name=old_version::$CURRENT_TAG"
echo "::set-output name=major_update::true"
else
cat <<EOF >> "$GITHUB_OUTPUT"
cat <<EOF >> "$GITHUB_OUTPUT"
new_version=$NEW_MAJOR_TAG
old_version=$CURRENT_TAG
major_update=true
EOF
fi
fi
else
NEW_MAJOR_TAG=$(echo "$NEW_TAG" | cut -d. -f1)
Expand All @@ -94,15 +72,9 @@ else
done
fi

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

0 comments on commit 7da2667

Please sign in to comment.