initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
37
github/codeql-action-v2/node_modules/@actions/cache/lib/internal/config.js
generated
vendored
Normal file
37
github/codeql-action-v2/node_modules/@actions/cache/lib/internal/config.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getCacheServiceURL = exports.getCacheServiceVersion = exports.isGhes = void 0;
|
||||
function isGhes() {
|
||||
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
|
||||
const isGitHubHost = hostname === 'GITHUB.COM';
|
||||
const isGheHost = hostname.endsWith('.GHE.COM');
|
||||
const isLocalHost = hostname.endsWith('.LOCALHOST');
|
||||
return !isGitHubHost && !isGheHost && !isLocalHost;
|
||||
}
|
||||
exports.isGhes = isGhes;
|
||||
function getCacheServiceVersion() {
|
||||
// Cache service v2 is not supported on GHES. We will default to
|
||||
// cache service v1 even if the feature flag was enabled by user.
|
||||
if (isGhes())
|
||||
return 'v1';
|
||||
return process.env['ACTIONS_CACHE_SERVICE_V2'] ? 'v2' : 'v1';
|
||||
}
|
||||
exports.getCacheServiceVersion = getCacheServiceVersion;
|
||||
function getCacheServiceURL() {
|
||||
const version = getCacheServiceVersion();
|
||||
// Based on the version of the cache service, we will determine which
|
||||
// URL to use.
|
||||
switch (version) {
|
||||
case 'v1':
|
||||
return (process.env['ACTIONS_CACHE_URL'] ||
|
||||
process.env['ACTIONS_RESULTS_URL'] ||
|
||||
'');
|
||||
case 'v2':
|
||||
return process.env['ACTIONS_RESULTS_URL'] || '';
|
||||
default:
|
||||
throw new Error(`Unsupported cache service version: ${version}`);
|
||||
}
|
||||
}
|
||||
exports.getCacheServiceURL = getCacheServiceURL;
|
||||
//# sourceMappingURL=config.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue