Skip to content
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

When writing a file: 422 (Unprocessable Entity) #631

Open
leobenkel opened this issue Nov 21, 2020 · 0 comments
Open

When writing a file: 422 (Unprocessable Entity) #631

leobenkel opened this issue Nov 21, 2020 · 0 comments

Comments

@leobenkel
Copy link

Hello,

I am trying to write a file doing:

new GitHub(authPayload)
    .getRepo(githubUsername, repoName)
    .writeFile(null, path, content, commitMessage, {
                    encode: true,
                    author: null,
                    committer: null
    })

But i am getting a 422 (Unprocessable Entity). This is a new file, and I am seeing in the log the 404 (Not Found) from the call trying to get the SHA which is correct ( i dont understand why this is dumped into the console tho...).

Looking online at https://developer.github.com/v3/repos/contents/#create-or-update-file-contents , it seems that when author and committer are used , then we need to specify name and author. But in my case, I would like to use the default behavior which is to use the authenticated user.

When I look at http://github-tools.github.io/github/docs/3.2.3/Repository.js.html#line750 , it seems that the keys are set. Should they not be here at all, in case they are not given in the option payload ?

Thank you !

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

No branches or pull requests

1 participant