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
Pushing a tree #1308
Comments
What is the value of |
It should be as simple as the code here: without the last step creating the pull request |
From my example above:
Yes.
That was exactly my thoughts. Where I say "Here's my code (borrowed somewhat from here):" I'm actually pointing to that exact same repo. |
Can you try return await octokit().git.updateRef({
owner,
repo,
sha: latestCommitSha,
- ref: `refs/heads/${head}`,
+ ref: `heads/${head}`,
force: true
}) |
https://octokit.github.io/rest.js/#api-Git-createRef says about
...but weirdly, your suggestion worked. Thanks! Are the docs wrong? |
Actually, I'm using https://octokit.github.io/rest.js/#api-Git-updateRef which does not have a doc for |
yeah, it’s a known API weirdness :/ many folks run into this, including myself. I’m considering to normalize the |
Well, thanks again. I do appreciate you taking time out on a Saturday to look at this. |
Not sure if I should open a new issue for this question or whether it's a good idea to beef up this issue with extra info, but I'm now wondering how to push a tree containing images, or non-text content type. It seems as if content negotiation isn't happening automatically on file extension, and the docs at https://octokit.github.io/rest.js/#api-Git-createTree don't show any obvious option to do this either. Here's the last bit of the example above modified:
And the resulting image is just the base64 string: |
octokit/rest.js#1308 gr2m/octokit-plugin-create-pull-request#6
I tried these steps: https://github.com/octokit/rest.js/issues/509#issuecomment-370764629
Using version
16.23.2
.Here's my code (borrowed somewhat from here):
I'm sure it's a simple fix, but whether I'm creating or updating the ref, I'm getting an error.
Thanks!
The text was updated successfully, but these errors were encountered: