Fix use of wrong URL
This commit is contained in:
parent
3ffe4b7421
commit
f5d645fc73
19 changed files with 19 additions and 34 deletions
|
|
@ -39,7 +39,7 @@ async function run() {
|
|||
core.getInput('checkout_path'),
|
||||
core.getInput('matrix'),
|
||||
core.getInput('token'),
|
||||
util.getRequiredEnvParam('GITHUB_API_URL'),
|
||||
util.getRequiredEnvParam('GITHUB_SERVER_URL'),
|
||||
core.getInput('upload') === 'true',
|
||||
'actions',
|
||||
core.getInput('output'),
|
||||
|
|
|
|||
|
|
@ -51,6 +51,6 @@ function parseAuth(auth: string): string {
|
|||
export function getActionsApiClient(allowLocalRun = false) {
|
||||
return getApiClient(
|
||||
core.getInput('token'),
|
||||
getRequiredEnvParam('GITHUB_API_URL'),
|
||||
getRequiredEnvParam('GITHUB_SERVER_URL'),
|
||||
allowLocalRun);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ async function run() {
|
|||
codeql = await initCodeQL(
|
||||
core.getInput('tools'),
|
||||
core.getInput('token'),
|
||||
util.getRequiredEnvParam('GITHUB_API_URL'),
|
||||
util.getRequiredEnvParam('GITHUB_SERVER_URL'),
|
||||
util.getRequiredEnvParam('RUNNER_TEMP'),
|
||||
util.getRequiredEnvParam('RUNNER_TOOL_CACHE'),
|
||||
'actions',
|
||||
|
|
@ -74,7 +74,7 @@ async function run() {
|
|||
codeql,
|
||||
util.getRequiredEnvParam('GITHUB_WORKSPACE'),
|
||||
core.getInput('token'),
|
||||
util.getRequiredEnvParam('GITHUB_API_URL'),
|
||||
util.getRequiredEnvParam('GITHUB_SERVER_URL'),
|
||||
logger);
|
||||
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -55,10 +55,6 @@ export function setupTests(test: TestInterface<any>) {
|
|||
// process.env only has strings fields, so a shallow copy is fine.
|
||||
t.context.env = {};
|
||||
Object.assign(t.context.env, process.env);
|
||||
|
||||
// Any test that runs code that expects to only be run on actions
|
||||
// will depend on various environment variables.
|
||||
process.env['GITHUB_API_URL'] = 'https://github.localhost/api/v3';
|
||||
});
|
||||
|
||||
typedTest.afterEach.always(t => {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ async function run() {
|
|||
core.getInput('checkout_path'),
|
||||
core.getInput('matrix'),
|
||||
core.getInput('token'),
|
||||
util.getRequiredEnvParam('GITHUB_API_URL'),
|
||||
util.getRequiredEnvParam('GITHUB_SERVER_URL'),
|
||||
'actions',
|
||||
getActionsLogger());
|
||||
await sendSuccessStatusReport(startedAt, uploadStats);
|
||||
|
|
|
|||
|
|
@ -18,10 +18,6 @@ export type Mode = 'actions' | 'runner';
|
|||
*/
|
||||
export const GITHUB_DOTCOM_URL = "https://github.com";
|
||||
|
||||
/**
|
||||
* The API URL for github.com.
|
||||
*/
|
||||
export const GITHUB_DOTCOM_API_URL = "https://api.github.com";
|
||||
|
||||
/**
|
||||
* Get an environment parameter, but throw an error if it is not set.
|
||||
|
|
@ -292,7 +288,7 @@ export async function sendStatusReport<S extends StatusReportBase>(
|
|||
statusReport: S,
|
||||
ignoreFailures?: boolean): Promise<boolean> {
|
||||
|
||||
if (getRequiredEnvParam("GITHUB_API_URL") !== GITHUB_DOTCOM_API_URL) {
|
||||
if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) {
|
||||
core.debug("Not sending status report to GitHub Enterprise");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue