Skip to content

Commit

Permalink
Creating FORCE option
Browse files Browse the repository at this point in the history
  • Loading branch information
jcvegan committed Nov 30, 2023
1 parent 72cc9b6 commit 7b996a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret
- `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]
- `last`: show the single last commit
- `compare`: show all commits since previous repo tag number
- **FORCE** _(optional)_ - Enforce the brach creation even if there are no changes from the tag.

### Outputs

Expand Down
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ minor_string_token=${MINOR_STRING_TOKEN:-#minor}
patch_string_token=${PATCH_STRING_TOKEN:-#patch}
none_string_token=${NONE_STRING_TOKEN:-#none}
branch_history=${BRANCH_HISTORY:-compare}
force_branch_creation=${FORCE:-false}

# since https://github.blog/2022-04-12-git-security-vulnerability-announced/ runner uses?
git config --global --add safe.directory /github/workspace

Expand All @@ -45,6 +47,7 @@ echo -e "\tMINOR_STRING_TOKEN: ${minor_string_token}"
echo -e "\tPATCH_STRING_TOKEN: ${patch_string_token}"
echo -e "\tNONE_STRING_TOKEN: ${none_string_token}"
echo -e "\tBRANCH_HISTORY: ${branch_history}"
echo -e "\tFORCE: ${force_branch_creation}"

# verbose, show everything
if $verbose
Expand Down Expand Up @@ -124,7 +127,7 @@ tag_commit=$(git rev-list -n 1 "$tag" || true )
# get current commit hash
commit=$(git rev-parse HEAD)
# skip if there are no new commits for non-pre_release
if [ "$tag_commit" == "$commit" ]
if [ "$tag_commit" == "$commit" ] && [ "$force_branch_creation" == "false" ]
then
echo "No new commits since previous tag. Skipping..."
setOutput "new_tag" "$tag"
Expand Down

0 comments on commit 7b996a6

Please sign in to comment.