Question about GitHub API v3 – files –

Hey there,

I had a question on GitHub's API for creating a new file. According to the documentation, you need a filepath (base64) to upload. Is it possible to instead upload code as string and not a file?

This is because I'm building a chrome extension that looks at code and uploads it to GitHub repo. However, the code is "string" and I'm not sure how I can convert it to file first (without downloading to user's system) and then upload that file to Github. Is direct code commit not possible?

Reference: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-or-update-file-contents

Thanks a lot.

submitted by /u/bci-hacker
[link] [comments]

Read more here: https://www.reddit.com/r/github/comments/jyoevn/question_about_github_api_v3_files/

Content Attribution

This content was originally published by /u/bci-hacker at Github: social coding, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: