Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to push when single-commit: true #665

Closed
jhpratt opened this issue Apr 10, 2021 · 7 comments
Closed

Fails to push when single-commit: true #665

jhpratt opened this issue Apr 10, 2021 · 7 comments
Assignees
Labels
bug 🐦 Hacktoberfest help wanted 📲 version 4
Milestone

Comments

@jhpratt
Copy link

@jhpratt jhpratt commented Apr 10, 2021

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.

@jhpratt jhpratt added the bug 🐦 label Apr 10, 2021
@JamesIves
Copy link
Owner

@JamesIves JamesIves commented Apr 11, 2021

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
Copy link
Author

@jhpratt jhpratt commented Apr 11, 2021

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
Copy link
Owner

@JamesIves JamesIves commented Apr 11, 2021

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.

@JamesIves JamesIves added the version 4 label Apr 11, 2021
@jhpratt
Copy link
Author

@jhpratt jhpratt commented Apr 11, 2021

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

@JamesIves JamesIves added the help wanted 📲 label Apr 12, 2021
@JamesIves JamesIves added this to the 4.1.2 milestone Apr 12, 2021
@johan13
Copy link

@johan13 johan13 commented May 19, 2021

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
Copy link
Owner

@JamesIves JamesIves commented May 20, 2021

Milestone needs to be updated.

@JamesIves JamesIves removed this from the 4.1.2 milestone May 20, 2021
@JamesIves JamesIves added the Hacktoberfest label Oct 6, 2021
@JamesIves JamesIves self-assigned this Dec 20, 2021
@JamesIves JamesIves added this to the 4.2.0 milestone Jan 6, 2022
@JamesIves
Copy link
Owner

@JamesIves JamesIves commented Jan 6, 2022

This is resolved in 4.2.0 which is releasing today. Dependabot should pick up the patch if you have it configured!

randytarampi added a commit to randytarampi/me that referenced this issue Apr 23, 2022
…positories when the branch names are different...

Per JamesIves/github-pages-deploy-action#665 (comment)

Signed-off-by: Randy Tarampi <rt@randytarampi.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐦 Hacktoberfest help wanted 📲 version 4
Projects
None yet
Development

No branches or pull requests

3 participants