forked from ScottBrenner/generate-changelog-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert upstream change to entrypoint
- Loading branch information
1 parent
80efee2
commit 6912fd7
Showing
1 changed file
with
2 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |