mirror of
https://github.com/actions/setup-java.git
synced 2025-04-22 02:46:46 +00:00
pass the token input through on GHES
This commit is contained in:
parent
2c53c1a588
commit
b5bfbd2bba
2 changed files with 4 additions and 2 deletions
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
|
@ -104538,6 +104538,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
||||||
// TODO get these dynamically!
|
// TODO get these dynamically!
|
||||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
// We will need Microsoft to add an endpoint where we can query for versions.
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
|
const auth = !token ? undefined : `token ${token}`;
|
||||||
const owner = 'actions';
|
const owner = 'actions';
|
||||||
const repository = 'setup-java';
|
const repository = 'setup-java';
|
||||||
const branch = 'main';
|
const branch = 'main';
|
||||||
|
@ -104545,7 +104546,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
||||||
let releases = null;
|
let releases = null;
|
||||||
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||||
const headers = {
|
const headers = {
|
||||||
authorization: token,
|
authorization: auth,
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
};
|
};
|
||||||
let response = null;
|
let response = null;
|
||||||
|
|
|
@ -73,6 +73,7 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
// TODO get these dynamically!
|
// TODO get these dynamically!
|
||||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
// We will need Microsoft to add an endpoint where we can query for versions.
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
|
const auth = !token ? undefined : `token ${token}`;
|
||||||
const owner = 'actions';
|
const owner = 'actions';
|
||||||
const repository = 'setup-java';
|
const repository = 'setup-java';
|
||||||
const branch = 'main';
|
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 fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||||
|
|
||||||
const headers: OutgoingHttpHeaders = {
|
const headers: OutgoingHttpHeaders = {
|
||||||
authorization: token,
|
authorization: auth,
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue