Skip to content

Commit

Permalink
chore(node): update to node18
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Normand <[email protected]>
  • Loading branch information
Zenithar committed Dec 13, 2022
1 parent cd97098 commit 6e1f0c3
Show file tree
Hide file tree
Showing 114 changed files with 4,601 additions and 1,070 deletions.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
Can be a version range, in which case the latest version matching the range is chosen.
Minimum allowed version is v1.0.0. Must either be an existing semantic version (e.g. v1.0.0, 1.0.0) or a version range.
required: true
github-token:
description: |
GitHub access token used to get information from the GitHub API.
required: true
runs:
using: 'node12'
using: 'node18'
main: 'index.js'
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const toolCache = require('@actions/tool-cache');
const input = {
args: core.getInput('args'),
version: core.getInput('version'),
githubToken: core.getInput('github-token'),
};

const baseDownloadUrl = 'https://github.com/CycloneDX/cyclonedx-gomod/releases/download';
Expand Down Expand Up @@ -60,7 +61,12 @@ function buildDownloadUrl(version) {

async function getReleaseVersionMatchingRange(httpClient, range) {
core.info(`Determining latest release version of cyclonedx-gomod satisfying "${range}"`);
const responseJson = await httpClient.getJson('https://api.github.com/repos/CycloneDX/cyclonedx-gomod/releases');
const responseJson = await httpClient.getJson(
'https://api.github.com/repos/CycloneDX/cyclonedx-gomod/releases',
input.githubToken
? { Authorization: input.githubToken, ...{} }
: {}
);
if (responseJson === null) { // HTTP 404
throw new Error('Fetching latest release of cyclonedx-gomod failed: not found');
} else if (responseJson.statusCode !== 200) {
Expand Down
47 changes: 30 additions & 17 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions node_modules/@actions/core/lib/core.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 34 additions & 10 deletions node_modules/@actions/core/lib/core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6e1f0c3

Please sign in to comment.