Skip to content

Commit

Permalink
#minor This adds an optional "verbose" tag
Browse files Browse the repository at this point in the history
For larger projects, printing the git logs can be very noisy in action logs, making it difficult to debug, etc. This optional flag is defaulted to 'true' to keep functionality familiar for existing workflows.
  • Loading branch information
adam-berrio committed Oct 23, 2020
1 parent e147364 commit ed2adee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` to be sure you retrieve all
* **INITIAL_VERSION** *(optional)* - Set initial version before bump. Default `0.0.0`.
* **TAG_CONTEXT** *(optional)* - Set the context of the previous tag. Possible values are `repo` (default) or `branch`.
* **PRERELEASE_SUFFIX** *(optional)* - Suffix for your prerelease versions, `beta` by default. Note this will only be used if a prerelease branch.
* **VERBOSE** *(optional)* - Print git logs. For some projects these logs may be very large. Possible values are ```true``` (default) and ```false```.

#### Outputs

Expand Down
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dryrun=${DRY_RUN:-false}
initial_version=${INITIAL_VERSION:-0.0.0}
tag_context=${TAG_CONTEXT:-repo}
suffix=${PRERELEASE_SUFFIX:-beta}
verbose=${VERBOSE:-true}

cd ${GITHUB_WORKSPACE}/${source}

Expand All @@ -25,6 +26,7 @@ echo -e "\tDRY_RUN: ${dryrun}"
echo -e "\tINITIAL_VERSION: ${initial_version}"
echo -e "\tTAG_CONTEXT: ${tag_context}"
echo -e "\tPRERELEASE_SUFFIX: ${suffix}"
echo -e "\tVERBOSE: ${verbose}"

current_branch=$(git rev-parse --abbrev-ref HEAD)

Expand Down Expand Up @@ -77,7 +79,11 @@ if [ "$tag_commit" == "$commit" ]; then
exit 0
fi

echo $log
# echo log if verbose is wanted
if $verbose
then
echo $log
fi

case "$log" in
*#major* ) new=$(semver -i major $tag); part="major";;
Expand Down

0 comments on commit ed2adee

Please sign in to comment.