-
Hi, I am at my first experience with Octokit and I am trying to create a pull request to a repo, clicking a button. First thing first I am creating a In the long term, what I am trying to achieve is:
To satisfy the point 1) I am using the following method
But I am getting 422 - Object does not exist. Any clue on why I might be getting it? Thank you for your help and any clarification! Haven't found any solution on the internet, and yes I am following the documentation here |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
👋🏻 Hi there! If you're creating a branch using For example, if I wanted to create a branch called await octokit.request('POST /repos/{owner}/{repo}/git/refs', {
owner: 'octokit',
repo: 'octokit.js',
ref: 'refs/heads/tim-tim-tim',
sha: '37d6fd6e8f50dc75fb82e2de3e8bb70359a9b578'
}) Can you give that a go and let me know how you get on? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the heads up @oscard0m I wish this was something implemented and maintained by Octokit? In general I trie to use packages from trusted sources, used and maintained bigger organizations. Can you tell me anything that might let me be more sure about using it? Don't get me wrong, having a look it looks exactly what I need!! |
Beta Was this translation helpful? Give feedback.
👋🏻 Hi there!
If you're creating a branch using
POST /repos/{owner}/{repo}/git/refs
, you use theref
to set the name of the new branch and thesha
to point to the Git commit SHA which should be theHEAD
of that branch.For example, if I wanted to create a branch called
tim-tim-tim
inoctokit/octokit.js
and point it to commit37d6fd6e8f50dc75fb82e2de3e8bb70359a9b578
, then I'd use the following code:Can you give that a go and let me know how you get on?