(owner, repo, ref)
| 4 | |
| 5 | // https://docs.github.com/rest/reference/git#get-a-reference |
| 6 | export async function getCommitSha(owner, repo, ref) { |
| 7 | try { |
| 8 | const { data } = await github.git.getRef({ |
| 9 | owner, |
| 10 | repo, |
| 11 | ref, |
| 12 | }) |
| 13 | return data.object.sha |
| 14 | } catch (err) { |
| 15 | console.log('error getting tree') |
| 16 | throw err |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | // https://docs.github.com/rest/reference/git#list-matching-references |
| 21 | export async function listMatchingRefs(owner, repo, ref) { |