Skip to content

Commit 11a6e5f

Browse files
Merge pull request #364 from zmynx/master
feat: allow for clean tag pushing
2 parents e256565 + 35d037a commit 11a6e5f

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ The following is an extended example with all available options.
5858
```yaml
5959
- uses: stefanzweifel/git-auto-commit-action@v5
6060
with:
61+
# Perform a clean git tag and push, without commiting anything
62+
# Default to false
63+
git_tag_only: false
64+
6165
# Optional. Commit message for the created commit.
6266
# Defaults to "Apply automatic changes"
6367
commit_message: Automated Change

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: 'Automatically commits files which have been changed during the wor
44
author: Stefan Zweifel <[email protected]>
55

66
inputs:
7+
git_tag_only:
8+
description: Perform a clean git tag and push, without commiting anything
9+
required: false
10+
default: false
711
commit_message:
812
description: Commit message
913
required: false

entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ _main() {
3030
_check_if_git_is_available
3131

3232
_switch_to_repository
33-
34-
if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
33+
if "$INPUT_GIT_TAG_ONLY"; then
34+
_log "debug" "git tag only.";
35+
_set_github_output "git_tag_only" "true"
36+
_tag_commit
37+
_push_to_github
38+
elif _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
3539

3640
_set_github_output "changes_detected" "true"
3741

tests/git-auto-commit.bats

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ setup() {
2121
export FAKE_DEFAULT_BRANCH=$(git config init.defaultBranch)
2222

2323
# Set default INPUT variables used by the GitHub Action
24+
export INPUT_GIT_TAG_ONLY=false
2425
export INPUT_REPOSITORY="${FAKE_LOCAL_REPOSITORY}"
2526
export INPUT_COMMIT_MESSAGE="Commit Message"
2627
export INPUT_BRANCH="${FAKE_DEFAULT_BRANCH}"

0 commit comments

Comments
 (0)