From 3c6d9fbb072848a6a50cbac24f8c746f215e3c52 Mon Sep 17 00:00:00 2001 From: Santiago Bernhardt Date: Fri, 6 Jan 2023 09:50:43 +1300 Subject: [PATCH 1/2] add log compare --- README.md | 5 ++++- entrypoint.sh | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36260c41..9713c790 100755 --- a/README.md +++ b/README.md @@ -84,7 +84,10 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret - **MINOR_STRING_TOKEN** _(optional)_ - Change the default `#minor` commit message string tag. - **PATCH_STRING_TOKEN** _(optional)_ - Change the default `#patch` commit message string tag. - **NONE_STRING_TOKEN** _(optional)_ - Change the default `#none` commit message string tag. -- **BRANCH_HISTORY** _(optional)_ - Set the history of the branch for finding `#bumps`. Possible values `last` and `full` defaults to full history of the new branch. +- **BRANCH_HISTORY** _(optional)_ - Set the history of the branch for finding `#bumps`. Possible values `last`, `full` and `compare` defaults to `compare`. + - `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 #### Outputs diff --git a/entrypoint.sh b/entrypoint.sh index ff408802..3927727d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ major_string_token=${MAJOR_STRING_TOKEN:-#major} 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:-full} +branch_history=${BRANCH_HISTORY:-last} # since https://github.blog/2022-04-12-git-security-vulnerability-announced/ runner uses? git config --global --add safe.directory /github/workspace @@ -143,6 +143,7 @@ fi declare -A history_type=( ["last"]="$(git show -s --format=%B)" \ ["full"]="$(git log "${default_branch}"..HEAD --format=%B)" \ + ["compare"]="$(git log "${tag_commit}".."${commit}" --format=%B)" \ ) log=${history_type[${branch_history}]} printf "History:\n---\n%s\n---\n" "$log" From 082e4a510a41a5a6641e25f17a734858178f6785 Mon Sep 17 00:00:00 2001 From: Santiago Bernhardt Date: Fri, 6 Jan 2023 09:53:42 +1300 Subject: [PATCH 2/2] Default to compare --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3927727d..c651f777 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ major_string_token=${MAJOR_STRING_TOKEN:-#major} 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:-last} +branch_history=${BRANCH_HISTORY:-compare} # since https://github.blog/2022-04-12-git-security-vulnerability-announced/ runner uses? git config --global --add safe.directory /github/workspace