[v6] No longer switch branches locally and drop create_branch, skip_fetch and skip_checkout options#314
Merged
stefanzweifel merged 14 commits intov6-nextfrom Feb 5, 2025
Merged
Conversation
|
@stefanzweifel are you planning to release v6 anytime soon? |
Owner
Author
|
@ashleycaselli I think I will tag a new release in February/March 2025. Do the mentioned options mentioned here cause any problems for you right now? |
|
reame.md still uses v5 an doesn't reflect yaml changes needed to be done for the action to work |
Owner
Author
|
@cforiguar thanks! I will update the README asap. Edit: Updated the README in f9017b2. The 3 input options had been removed previously from the README. If you run into a problem, you have to be more specific than just "doesn't work". |
rasben
added a commit
to danskernesdigitalebibliotek/dpl-cms
that referenced
this pull request
Jul 29, 2025
V6 has removed the `create_branch` option, but apparantly it is not a problem as the `branch` option now works slightly differently. stefanzweifel/git-auto-commit-action#314
cavcrosby
added a commit
to cavcrosby/kubectl
that referenced
this pull request
Oct 11, 2025
This was done because said option was removed as of version 6 of the git-auto-commit GitHub action. Its removal shouldn't affect anything, as the local branch within the job will just be named gh-pages remotely. The GitHub pull request for this change is here: stefanzweifel/git-auto-commit-action#314.
crookm
pushed a commit
to interflare/orleans-marten
that referenced
this pull request
Mar 23, 2026
…tion to v6 (#30) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://enduringtech.dev/actions/commit-action](https://enduringtech.dev/actions/commit-action) | action | major | `v5.2.0` -> `v6.0.1` | --- ### Release Notes <details> <summary>actions/commit-action (https://enduringtech.dev/actions/commit-action)</summary> ### [`v6.0.1`](https://enduringtech.dev/actions/commit-action/blob/HEAD/CHANGELOG.md#v601---2025-06-11) [Compare Source](https://enduringtech.dev/actions/commit-action/compare/v6.0.0...v6.0.1) ##### Fixed - Disable Check if Repo is in Detached State ([#​379](stefanzweifel/git-auto-commit-action#379)) [@​stefanzweifel](https://github.com/@​stefanzweifel) ### [`v6.0.0`](https://enduringtech.dev/actions/commit-action/blob/HEAD/CHANGELOG.md#v600---2025-06-10) [Compare Source](https://enduringtech.dev/actions/commit-action/compare/v5.2.0...v6.0.0) ##### Added - Throw error early if repository is in a detached state ([#​357](stefanzweifel/git-auto-commit-action#357)) ##### Fixed - Fix PAT instructions with Dependabot ([#​376](stefanzweifel/git-auto-commit-action#376)) [@​Dreamsorcerer](https://github.com/@​Dreamsorcerer) ##### Removed - Remove support for `create_branch`, `skip_checkout`, `skip_Fetch` ([#​314](stefanzweifel/git-auto-commit-action#314)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zOC4yIiwidXBkYXRlZEluVmVyIjoiNDEuMzguMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://enduringtech.dev/interflare/orleans-marten/pulls/30 Reviewed-by: Matt <mattlcrook@icloud.com> Co-authored-by: Renovate Bot <renovate.svc@enduringtech.dev> Co-committed-by: Renovate Bot <renovate.svc@enduringtech.dev>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request tackles a long standing issue with this action: how the action works with branches internally.
Since forever, the action will switch branches locally, if a branch name is provided through the
branch-option.This leads to a slew of problems, when users write workflows, where the repo is checked out using the default branch (
main) but the changes are then pushed to a different branch (example-branch-1) (Example: #301).This annoyed me for a long time. There's no need to check out the given branch locally. A local branch does not have to align with the remote branch in order to push a commit to said remote branch.
We can target the right target branch in the
git-pushcommand.This PR changes this behaviour by removing the
_switch_to_branchfunction completely.By removing the function, the action also no longer runs
git-fetch.The test suite of the action has been adjusted accordingly. Some tests have been removed. Some tests have been rewritten, as removing the
_switch_to_branchfunction changed the behaviour of the action in certain cases. See "Breaking Changes" section for details.As this is a breaking change, this change will be released in an upcoming major release (v6) of this Action.
Why I added the current behaviour of switching branches locally is a mistery to me. I probably wrote the code this way, as I personally always mirror the branch names in my local repository with my remote repository. (I would work on a branch called
feature-xand push that toorigin/feature-xand notorigin/development)Potential Issues
If a user checks out a repository on it's default branch (
main), makes changes to the repo and pushes the changes to remote branchexamplewhich already exists on remote and has newer commits, the action will fail to push to remote with an error message like this:The solution here will still be, that the user has to solve these "out-of-sync" issues on their own by adding a
git-pullorgit-rebasestep in their workflows.Breaking Changes
The following options have been removed from git-auto-commit and can be removed from your workflows.
create_branch(git-auto-commit no longer switches branches locally during a workflow run)skip_fetchskip_checkoutRelated Issues
create_branchshould be for remote only #295TODOs
UPGRADE.md