From 257715c7f092099ee2d58a5814fbe2b09ec7e498 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:31:12 +0000 Subject: [PATCH 1/6] docs: fix typo in README.md (#400) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e17642..7310480 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ If this Action doesn't work for your workflow, check out [EndBug/add-and-commit] ### Checkout the correct branch -You must use `action/checkout@v2` or later versions to check out the repository. +You must use `actions/checkout@v2` or later versions to check out the repository. In non-`push` events, such as `pull_request`, make sure to specify the `ref` to check out: ```yaml From 7cf2fc5057a6d4581fe455e426cebd171ede4b72 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:31:14 +0000 Subject: [PATCH 2/6] Add skip_push input option (#401) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7310480..b22938a 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,9 @@ The following is an extended example with all available options. # Optional. Skip internal call to `git checkout` skip_checkout: true + + # Optional. Skip internal call to `git push` + skip_push: true # Optional. Prevents the shell from expanding filenames. # Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html From 617fec07f385f55d65c928b1621bfa9759e3189a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:31:15 +0000 Subject: [PATCH 3/6] Add skip_push input option (#401) --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 4dbb7df..e652427 100644 --- a/action.yml +++ b/action.yml @@ -68,6 +68,10 @@ inputs: description: Skip the call to git-checkout. required: false default: false + skip_push: + description: Skip the call to git-push. + required: false + default: false disable_globbing: description: Stop the shell from expanding filenames (https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html) default: false From acad9d58802b041a78dc4a1375a66dba6c71c6ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:31:16 +0000 Subject: [PATCH 4/6] Add skip_push input option (#401) --- entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index d288a67..09fb6b7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -191,6 +191,10 @@ _tag_commit() { } _push_to_github() { + if "$INPUT_SKIP_PUSH"; then + _log "debug" "git-push will not be executed."; + return + fi echo "INPUT_BRANCH value: $INPUT_BRANCH"; From f91ff67f6dd85f62443e6bfa660f7179463ba792 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:31:17 +0000 Subject: [PATCH 5/6] Add skip_push input option (#401) --- tests/git-auto-commit.bats | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/git-auto-commit.bats b/tests/git-auto-commit.bats index d3b81df..9e39f7e 100644 --- a/tests/git-auto-commit.bats +++ b/tests/git-auto-commit.bats @@ -38,6 +38,7 @@ setup() { export INPUT_SKIP_DIRTY_CHECK=false export INPUT_SKIP_FETCH=false export INPUT_SKIP_CHECKOUT=false + export INPUT_SKIP_PUSH=false export INPUT_DISABLE_GLOBBING=false export INPUT_CREATE_BRANCH=false export INPUT_INTERNAL_GIT_BINARY=git @@ -352,6 +353,24 @@ cat_github_output() { assert_equal $current_sha $remote_sha } +@test "If SKIP_PUSH is true git-push will not be called" { + touch "${FAKE_LOCAL_REPOSITORY}"/new-file-{1,2,3}.txt + + INPUT_SKIP_PUSH=true + + run git_auto_commit + + assert_success + + assert_line "::debug::git-push will not be executed." + + # Assert that the sha values are not equal on local and remote + current_sha="$(git rev-parse --verify --short ${FAKE_DEFAULT_BRANCH})" + remote_sha="$(git rev-parse --verify --short origin/${FAKE_DEFAULT_BRANCH})" + + refute [assert_equal $current_sha $remote_sha] +} + @test "It can checkout a different branch" { # Create foo-branch and then immediately switch back to ${FAKE_DEFAULT_BRANCH} git checkout -b foo @@ -1501,4 +1520,4 @@ END remote_sha="$(git rev-parse --verify --short origin/${FAKE_DEFAULT_BRANCH})" assert_equal $current_sha $remote_sha -} \ No newline at end of file +} From b65198a9d8ab17395879771b01ee7054caa148e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:31:26 +0000 Subject: [PATCH 6/6] fix: apply code build script --- dist/entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/entrypoint.sh b/dist/entrypoint.sh index d288a67..09fb6b7 100755 --- a/dist/entrypoint.sh +++ b/dist/entrypoint.sh @@ -191,6 +191,10 @@ _tag_commit() { } _push_to_github() { + if "$INPUT_SKIP_PUSH"; then + _log "debug" "git-push will not be executed."; + return + fi echo "INPUT_BRANCH value: $INPUT_BRANCH";