-
Notifications
You must be signed in to change notification settings - Fork 188
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
How to upload file on GitHub using the module ? #155
Comments
Glad you like the module! Thanks for the feedback. For creating files, we need to use the Contents API. @Shazwazza just recently added the ability to get contents. Their plan was to add the create/update API next. Until that is done, the workaround would be to add new content via git API's instead. It looks like #150 is tracking the API's getting done. |
Thanks for the quick answer. Now my next step is to backup and migrate to Github. |
There's no way to change the content as part of that API. What you're looking for is the create/update contents API which hasn't been added yet, as mentioned. The workaround would be to make the desired changes, and then just use the normal git commands to push the changes up:
|
Thanks for answer one more time :-) |
Thanks for the feedback! |
I have found how to upload my file. $MyFile = @" Invoke-GHRestMethod -UriFragment "https://api.github.com/repos/damienvanrobaeys/myrepo/contents/myfile.txt" -Method PUT -Body $MyFile |
I complete my upload script. I proceed as below:
The script $Get_Selected_File = Read-Host "Type the path of the file to upload on your repo" $MyFile_JSON = @" If you're interested I can create a function like in your module for this part and submit it to you. |
I use another way to encode to base 64 because the previous one does not encode properly file and not encode exe, zip... correctly $Get_Selected_File = Read-Host "Type the path of the file to upload on your repo" $MyFile_JSON = @" |
The module is pretty awesome.
Just starting some tests with it but don't find how to upload file on github ?
I can create a readme using the autoinit parameter.
For now I'm searching how to add my own content into this readme then upload for instance an exe or script in the repository
The text was updated successfully, but these errors were encountered: