-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Commits that edit the same file squash into the first #3743
Commits that edit the same file squash into the first #3743
Comments
I think the problem is here: create-pull-request/src/github-helper.ts Lines 272 to 275 in 25575a1
where it is probably reading the file from the final commit, but putting it into a specific commit. I wonder if this would be better:
it works perfectly:
|
Arg, I am ... surprised ... I was able to close an issue on your repo from my repo ... but I don't have permission to reopen it 🤷. |
I'm using this in a GitHub Actions workflow that edits a few files in separate commits, and then PR's them. I've found that if two separate commits touch the same file, this action squashes all those edits into the first commit that edited the file.
I have a two examples to demonstrate the problem.
Three commits, each editing a log file and each creating a new file
In this example I have three steps (1,2,3) that append "step-N" to a file named
log
, create an empty filestep-N
, and make a commit for that step. When this is PR'd, it ends up with:step-1
file, andstep-1
,step-2
, andstep-3
, in the log file.I would instead expect step-1 commit to only include the step-1 line in the log, and step-2 and step-3 log lines to appear in their respective commits.
Three commits, each only editing a log file
In this example I have three steps (1,2,3) that append "step-N" to a file named
log
and make a commit for that step. When this is PR'd, it ends up with:log
file with the log lines from all three steps:step-1
,step-2
, andstep-3
.I would instead expect step-1 commit to only include the step-1 line in the log, and step-2 and step-3 log lines to appear in their respective commits.
--
Overall, I would expect each commit to be submitted in the pull request as originally committed, instead of having the changes squash.
The text was updated successfully, but these errors were encountered: