Skip to content

Commit

Permalink
Revert upstream change to entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmessinger committed Jun 16, 2021
1 parent 80efee2 commit 6912fd7
Showing 1 changed file with 2 additions and 56 deletions.
58 changes: 2 additions & 56 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,70 +1,16 @@
#!/bin/sh -l
# shellcheck disable=SC2039

# For Docker Image CI test job
if [ "$REPO" = "ScottBrenner/generate-changelog-action" ]; then
git clone --quiet https://github.com/"$REPO"
cd generate-changelog-action || exit
fi
git clone --quiet https://github.com/$REPO &> /dev/null

echo "Generating commit range for the following tag range:"
echo $TAG_RANGE

changelog=$(generate-changelog $* --tag $TAG_RANGE --file -)

if [ -z "$FROM_TAG" ]; then
echo "No from-tag passed. Fallbacking to git previous tag."
previous_tag=$(git tag --sort version:refname | tail -n 2 | head -n 1)
else
echo "From-tag detected. Using its value."
previous_tag=$FROM_TAG
fi

if [ -z "$TO_TAG" ]; then
echo "No to-tag passed. Fallbacking to git previous tag."
new_tag=$(git tag --sort version:refname | tail -n 1)
else
echo "To-tag detected. Using its value."
new_tag=$TO_TAG
fi

if [ -z "$TYPE" ]; then
echo "No type passed. Fallbacking to unset."
else
echo "Type detected. Using its value."
case $TYPE in
patch)
changelog_type="--patch"
;;
minor)
changelog_type="--minor"
;;
major)
changelog_type="--major"
;;
esac
fi

if [ -z "$EXCLUDE" ]; then
echo "No commit types selected to exclude. Fallbacking to unset."
else
echo "Commit types selected to exclude. Using its value."
exclude_types="--exclude $EXCLUDE"
fi

if [ -z "$ALLOW_UKNOWN" ]; then
echo "Unknown commit types not allowed."
else
echo "Allowing unknown commit types."
unknown_commits="--allow-unknown "
fi

changelog=$(generate-changelog "$changelog_type" -t "$previous_tag..$new_tag" "$exclude_types" "$unknown_commits" --file -)
echo $changelog

changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"

echo "$changelog"

echo "::set-output name=changelog::$changelog"

0 comments on commit 6912fd7

Please sign in to comment.