mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-04-20 16:59:42 +08:00
Merge pull request #364 from zmynx/master
feat: allow for clean tag pushing
This commit is contained in:
commit
11a6e5f38f
@ -58,6 +58,10 @@ The following is an extended example with all available options.
|
||||
```yaml
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
# Perform a clean git tag and push, without commiting anything
|
||||
# Default to false
|
||||
git_tag_only: false
|
||||
|
||||
# Optional. Commit message for the created commit.
|
||||
# Defaults to "Apply automatic changes"
|
||||
commit_message: Automated Change
|
||||
|
@ -4,6 +4,10 @@ description: 'Automatically commits files which have been changed during the wor
|
||||
author: Stefan Zweifel <stefan@stefanzweifel.dev>
|
||||
|
||||
inputs:
|
||||
git_tag_only:
|
||||
description: Perform a clean git tag and push, without commiting anything
|
||||
required: false
|
||||
default: false
|
||||
commit_message:
|
||||
description: Commit message
|
||||
required: false
|
||||
|
@ -30,8 +30,12 @@ _main() {
|
||||
_check_if_git_is_available
|
||||
|
||||
_switch_to_repository
|
||||
|
||||
if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
|
||||
if "$INPUT_GIT_TAG_ONLY"; then
|
||||
_log "debug" "git tag only.";
|
||||
_set_github_output "git_tag_only" "true"
|
||||
_tag_commit
|
||||
_push_to_github
|
||||
elif _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
|
||||
|
||||
_set_github_output "changes_detected" "true"
|
||||
|
||||
|
@ -21,6 +21,7 @@ setup() {
|
||||
export FAKE_DEFAULT_BRANCH=$(git config init.defaultBranch)
|
||||
|
||||
# Set default INPUT variables used by the GitHub Action
|
||||
export INPUT_GIT_TAG_ONLY=false
|
||||
export INPUT_REPOSITORY="${FAKE_LOCAL_REPOSITORY}"
|
||||
export INPUT_COMMIT_MESSAGE="Commit Message"
|
||||
export INPUT_BRANCH="${FAKE_DEFAULT_BRANCH}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user