Skip to content

Commit d4aee0c

Browse files
authored
Merge pull request #11 from Zenithar/feat_gha_support_github_token
feat(gha): support github token.
2 parents eaa676a + a14c47b commit d4aee0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ function buildDownloadUrl(version) {
6060

6161
async function getReleaseVersionMatchingRange(httpClient, range) {
6262
core.info(`Determining latest release version of cyclonedx-gomod satisfying "${range}"`);
63-
const responseJson = await httpClient.getJson('https://api.github.com/repos/CycloneDX/cyclonedx-gomod/releases');
63+
const responseJson = await httpClient.getJson(
64+
'https://api.github.com/repos/CycloneDX/cyclonedx-gomod/releases',
65+
process.env.GITHUB_TOKEN
66+
? { Authorization: process.env.GITHUB_TOKEN, ...{} }
67+
: {}
68+
);
6469
if (responseJson === null) { // HTTP 404
6570
throw new Error('Fetching latest release of cyclonedx-gomod failed: not found');
6671
} else if (responseJson.statusCode !== 200) {

0 commit comments

Comments
 (0)