Skip to content

Fails to push when single-commit: true #665

Closed
@jhpratt

Description

@jhpratt

Describe the bug

Fails to push when using single-commit: true

Reproduction Steps

Check this section, which is the exact setup used for the failed CI run (linked below).

I believe this only occurs because I use the main branch name, but I have not tested it when using master.

Logs

https://github.com/time-rs/time/runs/2314741348?check_suite_focus=true#step:7:43

Additional Comments

This works fine when single-commit: true is not present.

Activity

JamesIves

JamesIves commented on Apr 11, 2021

@JamesIves
Owner

This looks like it's occurring because you're trying to squash the commits on the same branch you're deploying from which is not what single-commit was really designed to do. It's intended to be used when squashing commits on a separate deployment branch to keep the history clean while preserving the timeline on the base branch.

Are you sure you actually want to do this? It's going to mean your main branch has a single commit if this process were to succeed.

jhpratt

jhpratt commented on Apr 11, 2021

@jhpratt
Author

I'm deploying it to a separate repository (time-rs/time-rs.github.io from time-rs/time). If I were deploying it to the same repo (and same branch), I'd absolutely agree — it should fail because it's almost certainly incorrect.

I think you may have missed that they're different repos when looking it over. It worked prior to that commit, though I was using v3 then. I would like to have a single commit on the target repo/branch, which I believe is what the single-commit option is intended for, no?

JamesIves

JamesIves commented on Apr 11, 2021

@JamesIves
Owner

Ah, I did miss that, my bad. I think this is failing for the same reason I mentioned in my last post because of how v4 checks out the remote. It's technically trying to squash commits on the base branch that you're deploying to, just in a different repo.

I'll need to do some investigation on the right way to handle this type of configuration. For now I'd suggest omitting the single-commit option or rolling back to version 3 if it's absolutely necessary.

jhpratt

jhpratt commented on Apr 11, 2021

@jhpratt
Author

Sounds good! I've already omitted the option which works as expected. Thanks for the quick responses.

added this to the 4.1.2 milestone on Apr 12, 2021
johan13

johan13 commented on May 19, 2021

@johan13

This is on the 4.1.2 milestone. I am running 4.1.3, but the problem appears to still be there. Is it just the milestone that needs to be updated, or am I doing something wrong and this is now supposed to work?

Edit: I couldn't get 3.x to work, so I worked around this issue by using gh-pages as the branch name on the repository I am pushing to. That works fine. 👍

JamesIves

JamesIves commented on May 20, 2021

@JamesIves
Owner

Milestone needs to be updated.

removed this from the 4.1.2 milestone on May 20, 2021
self-assigned this
on Dec 20, 2021
added this to the 4.2.0 milestone on Jan 6, 2022

3 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐝This issue describes a bug.hacktoberfest🎃 Hacktoberfest related changes.help wanted ❕Extra attention is neededversion 4Issues related to version 4 of this action.

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @johan13@jhpratt@JamesIves

      Issue actions

        Fails to push when `single-commit: true` · Issue #665 · JamesIves/github-pages-deploy-action