Skip to content

Use direct force pushes by committing first to a temp branch#70

Merged
Andarist merged 10 commits into
mainfrom
temp-branch-strategy
May 22, 2026
Merged

Use direct force pushes by committing first to a temp branch#70
Andarist merged 10 commits into
mainfrom
temp-branch-strategy

Conversation

@Andarist
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/core.ts
Copy link
Copy Markdown
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some research to see if we can skip the rest.git.createBlob and call rest.git.createTree directly because the latter accepts contents to upload the blob as string directly, and we can use this most of the time for our usecase. So we don't really need separate API calls.

Obviously, being a general library if we can't assume every change is a text file, so we could add attempts to detect text vs binary and optimize accordingly. Binaries are not common so a few createBlob shouldn't be an issue.

But.. I'm fine with this approach anyway. I think we can explore that later if we want to.

@Andarist
Copy link
Copy Markdown
Member Author

Even without createBlob, the REST-based flow still requires getCommit+createTree+createCommit+updateRef in the basic happy path, which is quite annoying. But I'm not super fond of having to manage this temp branch here either... so well, tradeoffs 🤷‍♂️

We are only using this in changesets/action, so we could remodel this altogether - but honestly, I don't feel a strong urge to work on this. I feel that it's probably better to promote an "internal release bot" pattern because it solves both signed commits (well, I have not tried that but I feel it should solve that ;p) AND our PRs triggering the actions.

@Andarist Andarist added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 9f3d31c May 22, 2026
9 checks passed
@Andarist Andarist deleted the temp-branch-strategy branch May 22, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants