pass the token input through on GHES

This commit is contained in:
Dmitry Shibanov 2022-10-17 13:03:02 +02:00
parent 2c53c1a588
commit b5bfbd2bba
2 changed files with 4 additions and 2 deletions

3
dist/setup/index.js vendored
View File

@ -104538,6 +104538,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
// TODO get these dynamically!
// We will need Microsoft to add an endpoint where we can query for versions.
const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`;
const owner = 'actions';
const repository = 'setup-java';
const branch = 'main';
@ -104545,7 +104546,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
let releases = null;
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
const headers = {
authorization: token,
authorization: auth,
accept: 'application/vnd.github.VERSION.raw'
};
let response = null;

View File

@ -73,6 +73,7 @@ export class MicrosoftDistributions extends JavaBase {
// TODO get these dynamically!
// We will need Microsoft to add an endpoint where we can query for versions.
const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`;
const owner = 'actions';
const repository = 'setup-java';
const branch = 'main';
@ -82,7 +83,7 @@ export class MicrosoftDistributions extends JavaBase {
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
const headers: OutgoingHttpHeaders = {
authorization: token,
authorization: auth,
accept: 'application/vnd.github.VERSION.raw'
};