(owner, repo, sha)
| 71 | |
| 72 | // https://docs.github.com/rest/reference/git#get-a-blob |
| 73 | export async function getContentsForBlob(owner, repo, sha) { |
| 74 | const { data } = await github.git.getBlob({ |
| 75 | owner, |
| 76 | repo, |
| 77 | file_sha: sha, |
| 78 | }) |
| 79 | // decode blob contents |
| 80 | return Buffer.from(data.content, 'base64') |
| 81 | } |
| 82 | |
| 83 | // https://docs.github.com/rest/reference/repos#get-repository-content |
| 84 | export async function getContents(owner, repo, ref, path) { |