Skip to content

Commit 209d64f

Browse files
authored
Creating FORCE option (#296)
* Creating FORCE option * Changing name
1 parent 72cc9b6 commit 209d64f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret
104104
- `full`: attempt to show all history, does not work on rebase and squash due missing HEAD [should be deprecated in v2 is breaking many workflows]
105105
- `last`: show the single last commit
106106
- `compare`: show all commits since previous repo tag number
107+
- **FORCE_WITHOUT_CHANGES** _(optional)_ - Enforce the brach creation even if there are no changes from the tag.
107108

108109
### Outputs
109110

entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ minor_string_token=${MINOR_STRING_TOKEN:-#minor}
2121
patch_string_token=${PATCH_STRING_TOKEN:-#patch}
2222
none_string_token=${NONE_STRING_TOKEN:-#none}
2323
branch_history=${BRANCH_HISTORY:-compare}
24+
force_without_changes=${FORCE_WITHOUT_CHANGES:-false}
25+
2426
# since https://github.blog/2022-04-12-git-security-vulnerability-announced/ runner uses?
2527
git config --global --add safe.directory /github/workspace
2628

@@ -45,6 +47,7 @@ echo -e "\tMINOR_STRING_TOKEN: ${minor_string_token}"
4547
echo -e "\tPATCH_STRING_TOKEN: ${patch_string_token}"
4648
echo -e "\tNONE_STRING_TOKEN: ${none_string_token}"
4749
echo -e "\tBRANCH_HISTORY: ${branch_history}"
50+
echo -e "\tFORCE: ${force_without_changes}"
4851

4952
# verbose, show everything
5053
if $verbose
@@ -124,7 +127,7 @@ tag_commit=$(git rev-list -n 1 "$tag" || true )
124127
# get current commit hash
125128
commit=$(git rev-parse HEAD)
126129
# skip if there are no new commits for non-pre_release
127-
if [ "$tag_commit" == "$commit" ]
130+
if [ "$tag_commit" == "$commit" ] && [ "$force_without_changes" == "false" ]
128131
then
129132
echo "No new commits since previous tag. Skipping..."
130133
setOutput "new_tag" "$tag"

0 commit comments

Comments
 (0)