You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possible optimizations for commitMode: github-api #474
When commitMode: github creates a pull request, it does the following:
It first pushes the base branch to the changeset branch <- This could be removed
Then commits the result from version
Then opens a pull request
And on subsequent changes, it also closes the pull request before opening a new one (in addition to the double push), which I suspect could be removed as well.
And on subsequent changes, it also closes the pull request before opening a new one (in addition to the double push), which I suspect could be removed as well.
I'm not seeing any calls in this action to explicitly close a pull request. Does all that happen in @changesets/ghcommit?
So with the GitHub API, there's no way to perform a force-push in a single operation with new content (i.e. file changes), you can only, in separate API calls:
create a new branch using an existing commit: createRef
update an existing branch to a different existing commit updateRef
update the existing branch to match the base branch first (which will then cause GitHub to automatically close the PR, as there's no diff).
add the new files using createCommitOnBranch
re-open the existing PR
If GitHub update the [createCommitOnBranch] mutation to allow us to specify a different parent commit / oid, then this would avoid the situation where PRs automatically close, and we could remove 2 API calls for existing branches. But until this happens I doubt there is much we can do.
Activity
h3rmanj commentedon May 9, 2025
I'm not seeing any calls in this action to explicitly close a pull request. Does all that happen in
@changesets/ghcommit?s0 commentedon May 9, 2025
So with the GitHub API, there's no way to perform a force-push in a single operation with new content (i.e. file changes), you can only, in separate API calls:
See our implementation here: https://github.com/changesets/ghcommit/blob/main/src/core.ts#L48
What this means is for existing PRs, we have to:
createCommitOnBranchIf GitHub update the [createCommitOnBranch] mutation to allow us to specify a different parent commit / oid, then this would avoid the situation where PRs automatically close, and we could remove 2 API calls for existing branches. But until this happens I doubt there is much we can do.
h3rmanj commentedon May 12, 2025
@s0 Thanks for taking a look! Sounds like there isn't anything we could do differently for commiting then.
I created a PR for the creation of tags/releases, but the impact of that is probably smaller.
revert(ci): merge version and release back into a single workflow
bluwy commentedon Jun 14, 2026
Second point is addressed in changesets/ghcommit#70