Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

18
managing github files via rest api
Post Flair (click to view more posts with a particular flair)
Post Body

hello, all!

i recently wanted to automate uploading and modifying github files, and the rest api was a good fit for me.

here is the instruction i found on how to generate your own token

https://channel9.msdn.com/Blogs/trevor-powershell/Automating-the-GitHub-REST-API-Using-PowerShell

and here's my result

https://github.com/gangstanthony/PowerShell/blob/master/GithubRestApi.ps1

it contains the following functions that work as you might expect

git-createfile
git-getfile
git-updatefile
git-deletefile
git-uploadfile

and here's a link to the rest api reference if you want to build out something else

https://docs.github.com/en/rest/reference/repos#get-repository-content

*edit: updated tutorial url:

https://web.archive.org/web/20211109164206/https://channel9.msdn.com/Blogs/trevor-powershell/Automating-the-GitHub-REST-API-Using-PowerShell

Author
Account Strength
100%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
5,440
Link Karma
847
Comment Karma
4,397
Profile updated: 4 days ago
Posts updated: 10 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago