add support for dragonwell (#532)

* add support for dragonwell

* fix: update logic of parsing json file, refactor code

* build: rebuild action

* chore: update error message

* build: rebuild action

* tests: fix unit tests, add e2e tests

* chore: prettier, lint and rebuild solution

* feat: add check for the package type, update unit tests

* tests: update e2e tests

* tests: remove excess entries from e2e tests

* feat: update logic of getting json file

* feat: add logic for backuping getting json

* chore: update wordings

* chore: fix typos, add additional logs

* fix: fix review points

* chore: rebuild solution

* chore: update wordings

* chore: refactor code

---------

Co-authored-by: Ivan Zosimov <ivanzosimov@github.com>
Co-authored-by: Ivan <98037481+IvanZosimov@users.noreply.github.com>
This commit is contained in:
Accelerator1996
2023-09-20 19:22:11 +08:00
committed by GitHub
parent 4075bfc1b5
commit 0ab4596768
12 changed files with 1918 additions and 20 deletions

View File

@ -7,6 +7,7 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
import {INPUT_JOB_STATUS, DISTRIBUTIONS_ONLY_MAJOR_VERSION} from './constants';
import {OutgoingHttpHeaders} from 'http';
export function getTempDir() {
const tempDirectory = process.env['RUNNER_TEMP'] || os.tmpdir();
@ -161,3 +162,13 @@ export function convertVersionToSemver(version: number[] | string) {
}
return mainVersion;
}
export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`;
const headers: OutgoingHttpHeaders = {
authorization: auth,
accept: 'application/vnd.github.VERSION.raw'
};
return headers;
}