Skip to content

Commit

Permalink
Merge pull request #48 from phish108/master
Browse files Browse the repository at this point in the history
Adding DRY_RUN feature that fixes #47
  • Loading branch information
anothrNick committed Feb 28, 2020
2 parents ebcbc0a + b1fed57 commit 25cc8cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -44,6 +44,7 @@ _NOTE: set the fetch-depth for `actions/checkout@master` to be sure you retrieve
* **RELEASE_BRANCHES** *(optional)* - Comma separated list of branches (bash reg exp accepted) that will generate the release tags. Other branches and pull-requests generate versions postfixed with the commit hash and do not generate any tag. Examples: `master` or `.*` or `release.*,hotfix.*,master` ...
* **CUSTOM_TAG** *(optional)* - Set a custom tag, useful when generating tag based on f.ex FROM image in a docker image. **Setting this tag will invalidate any other settings set!**
* **SOURCE** *(optional)* - Operate on a relative path under $GITHUB_WORKSPACE.
* **DRY_RUN** *(optional)* - Determine the next version without tagging the branch. The workflow can use the outputs `new_tag` and `tag` in subsequent steps. Possible values are ```true``` and ```false``` (default).

#### Outputs

Expand Down
10 changes: 10 additions & 0 deletions entrypoint.sh
Expand Up @@ -6,6 +6,7 @@ with_v=${WITH_V:-false}
release_branches=${RELEASE_BRANCHES:-master}
custom_tag=${CUSTOM_TAG}
source=${SOURCE:-.}
dryrun=${DRY_RUN:-false}

cd ${GITHUB_WORKSPACE}/${source}

Expand Down Expand Up @@ -80,8 +81,17 @@ echo $new

# set outputs
echo ::set-output name=new_tag::$new

# use dry run to determine the next tag
if $dryrun
then
echo ::set-output name=tag::$tag
exit 0
fi

echo ::set-output name=tag::$new


if $pre_release
then
echo "This branch is not a release branch. Skipping the tag creation."
Expand Down

0 comments on commit 25cc8cf

Please sign in to comment.