Add tests for GitHub License API fallback

This commit is contained in:
cnagadya
2022-10-13 11:57:38 +00:00
parent d1e9a12830
commit 4c0961eff6
6 changed files with 98 additions and 20 deletions

View File

@@ -65,13 +65,7 @@ const fetchGHLicense = async (
})
try {
const response = await octokit.request(
'GET /repos/{owner}/{repo}/license',
{
owner,
repo
}
)
const response = await octokit.rest.licenses.getForRepo({owner, repo})
return response.data.license?.spdx_id ?? null
} catch (_) {
return null