(owner, repo, ref)
| 51 | |
| 52 | // https://docs.github.com/rest/reference/git#get-a-tree |
| 53 | export async function getTree(owner, repo, ref) { |
| 54 | const commitSha = await getCommitSha(owner, repo, ref) |
| 55 | const treeSha = await getTreeSha(owner, repo, commitSha) |
| 56 | try { |
| 57 | const { data } = await github.git.getTree({ |
| 58 | owner, |
| 59 | repo, |
| 60 | tree_sha: treeSha, |
| 61 | recursive: 1, |
| 62 | }) |
| 63 | // only return files that match the patterns in allowedPaths |
| 64 | // skip actions/changes files |
| 65 | return data.tree |
| 66 | } catch (err) { |
| 67 | console.log('error getting tree') |
| 68 | throw err |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | // https://docs.github.com/rest/reference/git#get-a-blob |
| 73 | export async function getContentsForBlob(owner, repo, sha) { |
nothing calls this directly
no test coverage detected