Skip to content

Commit afe4b67

Browse files
authored
Merge pull request anothrNick#315 from druskus20/revert-revert-pr
Revert "Merge pull request anothrNick#313 from anothrNick/revert-310-master"
2 parents 6d01072 + e5fc474 commit afe4b67

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret
105105
- `last`: show the single last commit
106106
- `compare`: show all commits since previous repo tag number
107107
- **FORCE_WITHOUT_CHANGES** _(optional)_ - Enforce the brach creation even if there are no changes from the tag.
108+
- **FORCE_WITHOUT_CHANGES_PRE** _(optional)_ - Similar to force without changes, for pre-releases.
108109

109110
### Outputs
110111

entrypoint.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ patch_string_token=${PATCH_STRING_TOKEN:-#patch}
2222
none_string_token=${NONE_STRING_TOKEN:-#none}
2323
branch_history=${BRANCH_HISTORY:-compare}
2424
force_without_changes=${FORCE_WITHOUT_CHANGES:-false}
25+
force_without_changes_pre=${FORCE_WITHOUT_CHANGES:-false}
2526

2627
# since https://github.blog/2022-04-12-git-security-vulnerability-announced/ runner uses?
2728
git config --global --add safe.directory /github/workspace
@@ -47,7 +48,8 @@ echo -e "\tMINOR_STRING_TOKEN: ${minor_string_token}"
4748
echo -e "\tPATCH_STRING_TOKEN: ${patch_string_token}"
4849
echo -e "\tNONE_STRING_TOKEN: ${none_string_token}"
4950
echo -e "\tBRANCH_HISTORY: ${branch_history}"
50-
echo -e "\tFORCE: ${force_without_changes}"
51+
echo -e "\tFORCE_WITHOUT_CHANGES: ${force_without_changes}"
52+
echo -e "\tFORCE_WITHOUT_CHANGES_PRE: ${force_without_changes_pre}"
5153

5254
# verbose, show everything
5355
if $verbose
@@ -127,7 +129,7 @@ tag_commit=$(git rev-list -n 1 "$tag" || true )
127129
# get current commit hash
128130
commit=$(git rev-parse HEAD)
129131
# skip if there are no new commits for non-pre_release
130-
if [ "$tag_commit" == "$commit" ] && [ "$force_without_changes" == "false" ]
132+
if [ "$tag_commit" == "$commit" ] && [ "$force_without_changes" == "false" ]
131133
then
132134
echo "No new commits since previous tag. Skipping..."
133135
setOutput "new_tag" "$tag"
@@ -190,7 +192,7 @@ then
190192
# get current commit hash for tag
191193
pre_tag_commit=$(git rev-list -n 1 "$pre_tag" || true)
192194
# skip if there are no new commits for pre_release
193-
if [ "$pre_tag_commit" == "$commit" ]
195+
if [ "$pre_tag_commit" == "$commit" ] && [ "$force_without_changes_pre" == "false" ]
194196
then
195197
echo "No new commits since previous pre_tag. Skipping..."
196198
setOutput "new_tag" "$pre_tag"
@@ -281,4 +283,4 @@ EOF
281283
else
282284
# use git cli to push
283285
git push -f origin "$new" || exit 1
284-
fi
286+
fi

0 commit comments

Comments
 (0)