github-tools / github-tools/github

When writing a file: 422 (Unprocessable Entity)

オープン
#631 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
3.8k
フォーク
809
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

I am trying to write a file doing:

```javascript
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 !

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。