-
Notifications
You must be signed in to change notification settings - Fork 400
Custom prefix, optional versioning based on multiple commit messages #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
L-Sypniewski
wants to merge
69
commits into
anothrNick:master
from
L-Sypniewski:prefix-parameter-versioning-based-on-multiple-messages
Closed
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
e2b5085
Added new optional PREFIX parameter to define a tag prefix
L-Sypniewski 070e221
Implemented versioning based on multiple commit messages
L-Sypniewski e66606b
Prefix parameter versioning based on multiple messages (#1)
L-Sypniewski 5a98e7f
Updated README.md
3067bbc
Applied suggestions from PR
L-Sypniewski d0bf515
Updated description of WITH_V variable in README
L-Sypniewski 37e66bd
Added description for USE_LAST_COMMIT_ONLY variable in README
L-Sypniewski 23b0f66
Fixed README description for HEAD_COMMIT variable
L-Sypniewski 19edbd9
Restored logic broken after rebase
L-Sypniewski 4f9b1be
Merge branch 'master' into prefix-parameter-versioning-based-on-multi…
L-Sypniewski dc90ed7
Add BRANCH_LATEST_COMMIT parameter, fix logic, refactor
L-Sypniewski 64173b6
Print info about discarding calculated tag when custom tag is provided
L-Sypniewski 94705e4
Fixed printed variable name
L-Sypniewski e2e8a8e
Remove ShellCheck warnings
L-Sypniewski 824a7be
Fixed logic for calculating new tag
L-Sypniewski ab9c79f
If custom tag is provided no calculations are performed
L-Sypniewski 1b3231f
Fix syntax
L-Sypniewski 964d8ed
Restore syntax for bullet point list in readme
L-Sypniewski bc9eca9
Merge remote-tracking branch 'upstream/master' into prefix-parameter-…
L-Sypniewski 20eda4a
Fix typos in readme
L-Sypniewski 9554ac6
Merge remote-tracking branch 'upstream/master' into prefix-parameter-…
L-Sypniewski 2dc729e
Add VSCode task to run tests locally with Act
L-Sypniewski 71ad546
Merge remote-tracking branch 'upstream/master' into prefix-parameter-…
L-Sypniewski 7034383
Merge remote-tracking branch 'upstream/master' into prefix-parameter-…
L-Sypniewski a015466
Add tests
L-Sypniewski e3223ab
custom_string_token
L-Sypniewski c03197d
Initial tag creation tests - don't pass
L-Sypniewski 1ea1756
Fix initial tag logic
L-Sypniewski bad5519
bug fix
L-Sypniewski e848625
Remove redundant test, rename another
L-Sypniewski 6dab57b
remove `is_first_commit_used' param from set_number_of_found_keywords
L-Sypniewski e6b3aaf
Clean code related to logging
L-Sypniewski 8fbdd74
Handle the case of a repo with a single commit
L-Sypniewski 2f4c3b2
All tests are ran in a single job
L-Sypniewski a58ad8e
Fix shellcheck warnings
L-Sypniewski b3b6ee9
Fix a bug with duplicated prefix
L-Sypniewski f4fab45
Fix create-tag-tag-with-prefix-is-bumped-if-tag-with-given-prefix-alr…
L-Sypniewski e8eeee1
Remove unnecesseray output assignment
L-Sypniewski bedffb2
Fix formatting
L-Sypniewski f248ae1
Fix typo path->patch
L-Sypniewski 0beaa43
Bug fix: properly create a tag when initial version is provided with …
L-Sypniewski 0d44d90
Throw an error when INITIAL_VERSION is in incorrect format
L-Sypniewski 4967baa
Rename test cases
L-Sypniewski bac2fd1
Add custom-string-token-major-single-commit testcase
L-Sypniewski f9eeba8
Add custom-string-token-major-minor-patch-multiple-commits testcase
L-Sypniewski a2a7310
Add tests for WITH_V parameter
L-Sypniewski 8bd3fd4
Rename test to be more descriptive
L-Sypniewski 4b1ba1e
Remove verbose: true flags from tests
L-Sypniewski c660f7c
Add custom-tag-overrides-all-calculated-tags test
L-Sypniewski d2f1ce3
Update readme with information about correct format of INITIAL_VERSIO…
L-Sypniewski 66e31fa
Add merge-branch-no-new-tags-on-master-since-branching-off-merge-comm…
L-Sypniewski 1a092e8
Add merge-branch-new-tag-on-master-since-branching-off-merge-commit test
L-Sypniewski e9be947
Add merge-branch-no-new-tags-on-master-since-branching-off-fast-forwa…
L-Sypniewski 8048bb9
Add merge-branch-new-tag-on-master-since-branching-off-fast-forward test
L-Sypniewski ad6f189
Remove git logs from bash scripts
L-Sypniewski 29b81f0
Pipeline debug
L-Sypniewski eabf0cb
Remove quotes from assert script param to test if pipeline succeeds
L-Sypniewski 7995bc2
Unify style in 'if' condition
L-Sypniewski a734b87
Add quotes
L-Sypniewski 27a5053
Get rid of deprecated set-output and use $GITHUB_OUTPUT
L-Sypniewski ca8e54d
Change docker base image to fix 'detected dubious ownership in reposi…
L-Sypniewski 19ea1fe
Restore commented out code
L-Sypniewski 62cbc92
Disable schellcheck 2129 as it would break the logic
L-Sypniewski 22353ab
Remove dokcerfile warnings
L-Sypniewski fd2b0ea
Merge remote-tracking branch 'upstream/master' into prefix-parameter-…
L-Sypniewski 8cdc515
Use setOutput function
L-Sypniewski 7313ae6
Removed redundant line
L-Sypniewski a3563cb
Remove commented out parameter from test
L-Sypniewski 9c26878
Revert change from 7313ae6 as it is needed to output 'part' in some c…
L-Sypniewski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| GITHUB_STEP_SUMMARY=/dev/stdout |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| OUTPUT_NEWTAG=$1 | ||
| CORRECT_TAG=$2 | ||
|
|
||
| if [[ "${OUTPUT_NEWTAG}" == "${CORRECT_TAG}" ]]; then | ||
| echo "The tag was created correctly" >>"$GITHUB_STEP_SUMMARY" | ||
| rm -rf test-repo | ||
| else | ||
| echo "The tag was not created correctly, expected $CORRECT_TAG got $OUTPUT_NEWTAG" >>"$GITHUB_STEP_SUMMARY" | ||
| rm -rf test-repo | ||
| exit 1 | ||
| fi |
29 changes: 29 additions & 0 deletions
29
.github/workflows/tests/branch_latest_commit_new_tag_on_master_fast_forward.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1_master.txt" | ||
| touch 2.txt && git add . && git commit -m "2_master.txt" | ||
| git tag 1.1.1 | ||
|
|
||
| git checkout -b my-feature-branch | ||
| touch 3_feautre.txt && git add . && git commit -m "#minor 3_feature.txt" | ||
| touch 4_feautre.txt && git add . && git commit -m "4_feature.txt" | ||
| touch 5_feautre.txt && git add . && git commit -m "#minor 5_feature.txt" | ||
| echo "LATEST_FEATURE_BRANCH_COMMIT_SHA=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| git checkout master | ||
| touch 6.txt && git add . && git commit -m "#minor 6_master.txt" | ||
| touch 7.txt && git add . && git commit -m "#minor 7_master.txt" | ||
| git tag 2.3.4 | ||
|
|
||
| git checkout my-feature-branch | ||
| git rebase master | ||
|
|
||
| git merge my-feature-branch --no-edit --ff-only |
25 changes: 25 additions & 0 deletions
25
.github/workflows/tests/branch_latest_commit_new_tag_on_master_merge_commit.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1_master.txt" | ||
| touch 2.txt && git add . && git commit -m "2_master.txt" | ||
| git tag 1.1.1 | ||
|
|
||
| git checkout -b my-feature-branch | ||
| touch 3_feautre.txt && git add . && git commit -m "#minor 3_feature.txt" | ||
| touch 4_feautre.txt && git add . && git commit -m "4_feature.txt" | ||
| touch 5_feautre.txt && git add . && git commit -m "#minor 5_feature.txt" | ||
| echo "LATEST_FEATURE_BRANCH_COMMIT_SHA=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| git checkout master | ||
| touch 6.txt && git add . && git commit -m "#minor 6_master.txt" | ||
| touch 7.txt && git add . && git commit -m "#minor 7_master.txt" | ||
| git tag 2.3.4 | ||
| git merge my-feature-branch --no-edit |
28 changes: 28 additions & 0 deletions
28
.github/workflows/tests/branch_latest_commit_no_new_tags_on_master_fast_forward.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1_master.txt" | ||
| touch 2.txt && git add . && git commit -m "2_master.txt" | ||
| git tag 1.1.1 | ||
|
|
||
| git checkout -b my-feature-branch | ||
| touch 3_feautre.txt && git add . && git commit -m "#minor 3_feature.txt" | ||
| touch 4_feautre.txt && git add . && git commit -m "4_feature.txt" | ||
| touch 5_feautre.txt && git add . && git commit -m "#minor 5_feature.txt" | ||
| echo "LATEST_FEATURE_BRANCH_COMMIT_SHA=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| git checkout master | ||
| touch 6.txt && git add . && git commit -m "#minor 6_master.txt" | ||
| touch 7.txt && git add . && git commit -m "#minor 7_master.txt" | ||
|
|
||
| git checkout my-feature-branch | ||
| git rebase master | ||
|
|
||
| git merge my-feature-branch --no-edit --ff-only |
24 changes: 24 additions & 0 deletions
24
.github/workflows/tests/branch_latest_commit_no_new_tags_on_master_merge_commit.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1_master.txt" | ||
| touch 2.txt && git add . && git commit -m "2_master.txt" | ||
| git tag 1.1.1 | ||
|
|
||
| git checkout -b my-feature-branch | ||
| touch 3_feautre.txt && git add . && git commit -m "#minor 3_feature.txt" | ||
| touch 4_feautre.txt && git add . && git commit -m "4_feature.txt" | ||
| touch 5_feautre.txt && git add . && git commit -m "#minor 5_feature.txt" | ||
| echo "LATEST_FEATURE_BRANCH_COMMIT_SHA=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| git checkout master | ||
| touch 6.txt && git add . && git commit -m "#minor 6_master.txt" | ||
| touch 7.txt && git add . && git commit -m "#minor 7_master.txt" | ||
| git merge my-feature-branch --no-edit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1.txt" | ||
| git tag 1.1.1 | ||
| touch 2.txt && git add . && git commit -m "2.txt" | ||
| touch 3.txt && git add . && git commit -m "ma 3.txt" | ||
| touch 4.txt && git add . && git commit -m "4.txt" | ||
| touch 5.txt && git add . && git commit -m "ma 5.txt" | ||
| touch 6.txt && git add . && git commit -m "6.txt" | ||
| touch 7.txt && git add . && git commit -m "mi 7.txt" | ||
| touch 8.txt && git add . && git commit -m "pa 8.txt" | ||
| touch 9.txt && git add . && git commit -m "mi 9.txt" | ||
| touch 10.txt && git add . && git commit -m "mi 10.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1.txt" | ||
| touch 2.txt && git add . && git commit -m "2.txt" | ||
| git tag 1.1.1 | ||
| touch 3.txt && git add . && git commit -m "3.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "#major 1.txt" | ||
| touch 2.txt && git add . && git commit -m "#major 2.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1.txt" | ||
| git tag 1.1.1 | ||
| touch 2.txt && git add . && git commit -m "2.txt" | ||
| touch 3.txt && git add . && git commit -m "3.txt" | ||
| touch 4.txt && git add . && git commit -m "4.txt" | ||
| touch 5.txt && git add . && git commit -m "5.txt" | ||
| touch 6.txt && git add . && git commit -m "6.txt" |
20 changes: 20 additions & 0 deletions
20
.github/workflows/tests/several_commits_major_takes_precedence_over_patch.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1.txt" | ||
| git tag 1.1.1 | ||
| touch 2.txt && git add . && git commit -m "2.txt" | ||
| touch 3.txt && git add . && git commit -m "#patch 3.txt" | ||
| touch 4.txt && git add . && git commit -m "4.txt" | ||
| touch 5.txt && git add . && git commit -m "5.txt #patch" | ||
| touch 7.txt && git add . && git commit -m "6.txt #patch" | ||
| touch 8.txt && git add . && git commit -m "6.txt #minor" | ||
| touch 9.txt && git add . && git commit -m "6.txt #minor" | ||
| touch 10.txt && git add . && git commit -m "#minor_6.txt" |
17 changes: 17 additions & 0 deletions
17
.github/workflows/tests/several_mixed_tagged_and_not_tagged_commits.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1.txt" | ||
| git tag 1.1.1 | ||
| touch 2.txt && git add . && git commit -m "2.txt" | ||
| touch 3.txt && git add . && git commit -m "#minor 3.txt" | ||
| touch 4.txt && git add . && git commit -m "4.txt" | ||
| touch 5.txt && git add . && git commit -m "5.txt #minor" | ||
| touch 6.txt && git add . && git commit -m "6.txt" |
14 changes: 14 additions & 0 deletions
14
.github/workflows/tests/tag_with_prefix_is_bumped_if_tag_with_given_prefix_already_exists.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir test-repo | ||
| cd test-repo || exit 1 | ||
|
|
||
| git config --global init.defaultBranch master | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "Your Name" | ||
|
|
||
| git init | ||
| touch 1.txt && git add . && git commit -m "1.txt" | ||
| touch 2.txt && git add . && git commit -m "2.txt" | ||
| git tag prefix-1.1.1 | ||
| touch 3.txt && git add . && git commit -m "#patch 3.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "act - test run-tests", | ||
| "command": "act", | ||
| "options": { | ||
| "cwd": "${workspaceFolder}" | ||
| }, | ||
| "args": [ | ||
| "--rebuild", | ||
| "--job", | ||
| "run-tests", | ||
| "--env-file", | ||
| ".act/.env", | ||
| ], | ||
| "type": "shell", | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,7 @@ jobs: | |
| uses: anothrNick/[email protected] # Don't use @master unless you're happy to test the latest version | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| WITH_V: true | ||
| PREFIX: myprefix- | ||
| ``` | ||
|
|
||
| ```yaml | ||
|
|
@@ -60,7 +60,7 @@ jobs: | |
| uses: anothrNick/[email protected] # Don't use @master unless you're happy to test the latest version | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| WITH_V: true | ||
| PREFIX: myprefix- | ||
| ``` | ||
|
|
||
| Depending if you choose example 1 or example 2 is how crafted version bumps operate when reading the commit log. | ||
|
|
@@ -73,19 +73,22 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret | |
|
|
||
| **Environment Variables** | ||
|
|
||
| - **GITHUB_TOKEN** **_(required)_** - Required for permission to tag the repo. | ||
| - **DEFAULT_BUMP** _(optional)_ - Which type of bump to use when none explicitly provided (default: `minor`). | ||
| - **GITHUB_TOKEN** ***(required)*** - Required for permission to tag the repo. | ||
| - **DEFAULT_BUMP** *(optional)* - Which type of bump to use when none explicitly provided (default: `minor`). | ||
| - **DEFAULT_BRANCH** _(optional)_ - Overwrite the default branch its read from Github Runner env var but can be overwritten (default: `$GITHUB_BASE_REF`). Strongly recommended to set this var if using anything else than master or main as default branch otherwise in combination with history full will error. | ||
| - **WITH_V** _(optional)_ - Tag version with `v` character. | ||
| - **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). | ||
| - **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`. | ||
| - **WITH_V** **(deprecated)** *(optional)* - Tag version with `v` character. Deprecated variable - use `PREFIX` instead. | ||
| - **PREFIX** *(optional)* - Adds a prefix before version number. | ||
| - **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). | ||
| - **INITIAL_VERSION** *(optional)* - Set initial version before bump. Default `0.0.0`. It must be in a valid semver version format (optionally it can also be prefixed with PREFIX param, but it's not necessary even if PREFIX is specified). If the format is incorrect error is thrown. | ||
| - **TAG_CONTEXT** *(optional)* - Set the context of the previous tag. Possible values are `repo` (default) or `branch`. | ||
| - **PRERELEASE** _(optional)_ - Define if workflow runs in prerelease mode, `false` by default. Note this will be overwritten if using complex suffix release branches. | ||
| - **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`. | ||
| - **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```. | ||
| - **BRANCH_LATEST_COMMIT** *(optional)* - Commit messages for commits of a given branch will be taken into account while calculating a new tag. Specifying branch is useful when using this action for pull requests - one can set environment variable as follows: `BRANCH_LATEST_COMMIT: ${{ github.event.pull_request.head.sha }}` to calculate a new version basing on commits from a given PR. If not specified the current commit is used. | ||
| - **USE_LAST_COMMIT_ONLY** *(optional)* - True by default. If true only last commit is taken into account while bumping the version, otherwise all commits from the branch with the latest tag contribute to new tag calculation | ||
| - **MAJOR_STRING_TOKEN** _(optional)_ - Change the default `#major` commit message string tag. | ||
| - **MINOR_STRING_TOKEN** _(optional)_ - Change the default `#minor` commit message string tag. | ||
| - **PATCH_STRING_TOKEN** _(optional)_ - Change the default `#patch` commit message string tag. | ||
|
|
@@ -97,9 +100,10 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret | |
|
|
||
| ### Outputs | ||
|
|
||
| - **new_tag** - The value of the newly created tag. | ||
| - **tag** - The value of the latest tag after running this action. | ||
| - **part** - The part of version which was bumped. | ||
| - **new_tag** - The value of the newly created tag, e.g. my-prefix-1.2.3 | ||
| - **new_tag_without_prefix** - The value of the newly created tag without specified prefix, e.g 1.2.3 | ||
| - **tag** - The value of the latest tag before bumping it by running this action, e.g. my-prefix-1.2.2 | ||
| - **part** - The part of version which was bumped, e.g. minor | ||
|
|
||
| > **_Note:_** This action creates a [lightweight tag](https://developer.github.com/v3/git/refs/#create-a-reference). | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.