Skip to content

Commit

Permalink
fix: base64 encode README.md content
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 6, 2019
1 parent ff82dd2 commit 629a712
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/push/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function setup({ toolkit, octokit, payload, sha }) {
toolkit.info('"twitter-together-setup" branch created');

// Create tweets/README.md from same file in gr2m/twitter-together repo
// https://developer.github.com/v3/repos/contents/#create-a-file}
// https://developer.github.com/v3/repos/contents/#get-contents
const { data: readmeContent } = await octokit.request(
"GET /repos/:owner/:repo/contents/:path",
{
Expand All @@ -45,11 +45,12 @@ async function setup({ toolkit, octokit, payload, sha }) {
path: "tweets/README.md"
}
);
// https://developer.github.com/v3/repos/contents/#create-or-update-a-file
await octokit.request("PUT /repos/:owner/:repo/contents/:path", {
owner: payload.repository.owner.login,
repo: payload.repository.name,
path: "tweets/README.md",
content: readmeContent.toString("base64"),
content: Buffer.from(readmeContent).toString("base64"),
branch: "twitter-together-setup",
message: "twitter-together setup"
});
Expand Down

0 comments on commit 629a712

Please sign in to comment.