PowerShellForGitHub icon indicating copy to clipboard operation
PowerShellForGitHub copied to clipboard

API Completeness - Repositories - Content

Open raghav710 opened this issue 5 years ago • 8 comments

Tracking the addition of methods fo https://developer.github.com/v3/repos/contents

raghav710 avatar Mar 22 '20 14:03 raghav710

@HowardWolosky realized that this is needed for my other PRs (merging branches, updating refs). Would we be okay to get them merged and I can add test cases when I add this feature. Or would we want to push this in first?

raghav710 avatar Mar 28 '20 15:03 raghav710

@Shazwazza just added the Get contents method. They were interested in adding the create/update method next. @raghav710, were you looking to do this yourself, or were you just trying to track the need for it?

HowardWolosky avatar Apr 17 '20 14:04 HowardWolosky

@HowardWolosky that's great to know. I'm happy if @Shazwazza can take up create/update as well.

I just needed Content related APIs for writing the tests for my PRs and not especially wanting to do it by myself 👍

Hope you are fine. Stay safe 👍

raghav710 avatar Apr 18 '20 10:04 raghav710

Regarding the uploading part, I'm able to upload file (zip, rar, exe, pS1, txt, pdf ...) on github using the below code:

$File_To_Upload = Read-Host "Type the path of the file to upload" $Get_File_Name = (Get-ChildItem $File_To_Upload).name $Encoded_File = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes("$File_To_Uplo

{ "message": "", "content": "$Encoded_File" } "@

Invoke-GHRestMethod -UriFragment "https://api.github.com/repos/$owner/$repositoryname/contents/$Get_File_Name" -Method PUT -Body $MyFile_JSON

damienvanrobaeys avatar Apr 20 '20 11:04 damienvanrobaeys

Bumping this up to see if anyone is actively working on this. Two of the existing tests in GitHubContents.tests.ps1 are currently brittle because they start to fail anytime GitHub changes the default HTML presentation of their README.md file: Context 'For getting html (byte) file contents' and Context 'For getting html (string) file contents'

HowardWolosky avatar May 28 '20 19:05 HowardWolosky

@HowardWolosky I'm not working on this currently. But I can take this up after my existing PRs are done, if no one takes it up by then

raghav710 avatar May 30 '20 17:05 raghav710

Hi all, I don't have a whole lot of time at the moment so would be great if you could pick it up if you've got the time. I'll check back in a couple weeks when I hopefully have some extra time and see what the status is.

Shazwazza avatar Jun 01 '20 02:06 Shazwazza

Create or update a file has been completed in PR #241.

X-Guardian avatar Jun 29 '20 17:06 X-Guardian