Merge pull request #112 from DeterminateSystems/srv
Update detsys-ts for srv
This commit is contained in:
commit
41c8f7e1b5
3 changed files with 259 additions and 121 deletions
|
@ -29,6 +29,7 @@
|
||||||
"accessibility": "no-public"
|
"accessibility": "no-public"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"@typescript-eslint/no-base-to-string": "error",
|
||||||
"@typescript-eslint/no-require-imports": "error",
|
"@typescript-eslint/no-require-imports": "error",
|
||||||
"@typescript-eslint/array-type": "error",
|
"@typescript-eslint/array-type": "error",
|
||||||
"@typescript-eslint/await-thenable": "error",
|
"@typescript-eslint/await-thenable": "error",
|
||||||
|
|
341
dist/index.js
vendored
341
dist/index.js
vendored
|
@ -86333,6 +86333,8 @@ var external_node_util_ = __nccwpck_require__(7261);
|
||||||
var external_os_ = __nccwpck_require__(2037);
|
var external_os_ = __nccwpck_require__(2037);
|
||||||
;// CONCATENATED MODULE: external "node:crypto"
|
;// CONCATENATED MODULE: external "node:crypto"
|
||||||
const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
|
const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
|
||||||
|
;// CONCATENATED MODULE: external "node:dns/promises"
|
||||||
|
const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns/promises");
|
||||||
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js
|
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js
|
||||||
var cache = __nccwpck_require__(6878);
|
var cache = __nccwpck_require__(6878);
|
||||||
;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.1/node_modules/@sindresorhus/is/dist/index.js
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.1/node_modules/@sindresorhus/is/dist/index.js
|
||||||
|
@ -93726,14 +93728,14 @@ const got = source_create(defaults);
|
||||||
;// CONCATENATED MODULE: external "node:child_process"
|
;// CONCATENATED MODULE: external "node:child_process"
|
||||||
const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");
|
const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");
|
||||||
;// CONCATENATED MODULE: external "node:fs/promises"
|
;// CONCATENATED MODULE: external "node:fs/promises"
|
||||||
const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
|
const external_node_fs_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
|
||||||
;// CONCATENATED MODULE: external "node:path"
|
;// CONCATENATED MODULE: external "node:path"
|
||||||
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
|
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
|
||||||
;// CONCATENATED MODULE: external "node:stream/promises"
|
;// CONCATENATED MODULE: external "node:stream/promises"
|
||||||
const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises");
|
const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises");
|
||||||
;// CONCATENATED MODULE: external "node:zlib"
|
;// CONCATENATED MODULE: external "node:zlib"
|
||||||
const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib");
|
const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib");
|
||||||
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@5fcb0532d85556ebc2de286e483885976531339d_uqngfub4ls4loys67iy653x57e/node_modules/detsys-ts/dist/index.js
|
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@9d66d2c89c150f796165fdcc20b3be538807c0f4_46ybmzqhaua4eiwu3nj2qm63te/node_modules/detsys-ts/dist/index.js
|
||||||
var __defProp = Object.defineProperty;
|
var __defProp = Object.defineProperty;
|
||||||
var __export = (target, all) => {
|
var __export = (target, all) => {
|
||||||
for (var name in all)
|
for (var name in all)
|
||||||
|
@ -93819,9 +93821,9 @@ async function readAsyncOsReleaseFile(fileList, options) {
|
||||||
${fileData}`);
|
${fileData}`);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} catch (error2) {
|
} catch (error3) {
|
||||||
if (options.debug) {
|
if (options.debug) {
|
||||||
console.error(error2);
|
console.error(error3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93843,9 +93845,9 @@ function readSyncOsreleaseFile(releaseFileList, options) {
|
||||||
${fileData}`);
|
${fileData}`);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} catch (error2) {
|
} catch (error3) {
|
||||||
if (options.debug) {
|
if (options.debug) {
|
||||||
console.error(error2);
|
console.error(error3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94037,6 +94039,192 @@ function hashEnvironmentVariables(prefix, variables) {
|
||||||
return `${prefix}-${hash.digest("hex")}`;
|
return `${prefix}-${hash.digest("hex")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// src/errors.ts
|
||||||
|
function stringifyError(e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
return e.message;
|
||||||
|
} else if (typeof e === "string") {
|
||||||
|
return e;
|
||||||
|
} else {
|
||||||
|
return JSON.stringify(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// src/ids-host.ts
|
||||||
|
|
||||||
|
|
||||||
|
var DEFAULT_LOOKUP = "_detsys_ids._tcp.install.determinate.systems.";
|
||||||
|
var ALLOWED_SUFFIXES = [
|
||||||
|
".install.determinate.systems",
|
||||||
|
".install.detsys.dev"
|
||||||
|
];
|
||||||
|
var DEFAULT_IDS_HOST = "https://install.determinate.systems";
|
||||||
|
var LOOKUP = process.env["IDS_LOOKUP"] ?? DEFAULT_LOOKUP;
|
||||||
|
var IdsHost = class {
|
||||||
|
constructor(idsProjectName, diagnosticsSuffix, runtimeDiagnosticsUrl) {
|
||||||
|
this.idsProjectName = idsProjectName;
|
||||||
|
this.diagnosticsSuffix = diagnosticsSuffix;
|
||||||
|
this.runtimeDiagnosticsUrl = runtimeDiagnosticsUrl;
|
||||||
|
}
|
||||||
|
markCurrentHostBroken() {
|
||||||
|
this.prioritizedURLs?.shift();
|
||||||
|
}
|
||||||
|
setPrioritizedUrls(urls) {
|
||||||
|
this.prioritizedURLs = urls;
|
||||||
|
}
|
||||||
|
async getRootUrl() {
|
||||||
|
const idsHost = process.env["IDS_HOST"];
|
||||||
|
if (idsHost !== void 0) {
|
||||||
|
try {
|
||||||
|
return new URL(idsHost);
|
||||||
|
} catch (err) {
|
||||||
|
core.error(
|
||||||
|
`IDS_HOST environment variable is not a valid URL. Ignoring. ${stringifyError(err)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let url = void 0;
|
||||||
|
try {
|
||||||
|
const urls = await this.getUrlsByPreference();
|
||||||
|
url = urls[0];
|
||||||
|
} catch (err) {
|
||||||
|
core.error(
|
||||||
|
`Error collecting IDS URLs by preference: ${stringifyError(err)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (url === void 0) {
|
||||||
|
url = new URL(DEFAULT_IDS_HOST);
|
||||||
|
}
|
||||||
|
return new URL(url);
|
||||||
|
}
|
||||||
|
async getDiagnosticsUrl() {
|
||||||
|
if (this.runtimeDiagnosticsUrl === "") {
|
||||||
|
return void 0;
|
||||||
|
}
|
||||||
|
if (this.runtimeDiagnosticsUrl !== "-" && this.runtimeDiagnosticsUrl !== void 0) {
|
||||||
|
try {
|
||||||
|
return new URL(this.runtimeDiagnosticsUrl);
|
||||||
|
} catch (err) {
|
||||||
|
core.info(
|
||||||
|
`User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError(err)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const diagnosticUrl = await this.getRootUrl();
|
||||||
|
diagnosticUrl.pathname += this.idsProjectName;
|
||||||
|
diagnosticUrl.pathname += "/";
|
||||||
|
diagnosticUrl.pathname += this.diagnosticsSuffix || "diagnostics";
|
||||||
|
return diagnosticUrl;
|
||||||
|
} catch (err) {
|
||||||
|
core.info(
|
||||||
|
`Generated diagnostic endpoint ignored, and diagnostics are disabled: not a valid URL: ${stringifyError(err)}`
|
||||||
|
);
|
||||||
|
return void 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async getUrlsByPreference() {
|
||||||
|
if (this.prioritizedURLs === void 0) {
|
||||||
|
this.prioritizedURLs = orderRecordsByPriorityWeight(
|
||||||
|
await discoverServiceRecords()
|
||||||
|
).flatMap((record) => recordToUrl(record) || []);
|
||||||
|
}
|
||||||
|
return this.prioritizedURLs;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function recordToUrl(record) {
|
||||||
|
const urlStr = `https://${record.name}:${record.port}`;
|
||||||
|
try {
|
||||||
|
return new URL(urlStr);
|
||||||
|
} catch (err) {
|
||||||
|
core.debug(
|
||||||
|
`Record ${JSON.stringify(record)} produced an invalid URL: ${urlStr} (${err})`
|
||||||
|
);
|
||||||
|
return void 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function discoverServiceRecords() {
|
||||||
|
return await discoverServicesStub((0,promises_namespaceObject.resolveSrv)(LOOKUP), 1e3);
|
||||||
|
}
|
||||||
|
async function discoverServicesStub(lookup, timeout) {
|
||||||
|
const defaultFallback = new Promise(
|
||||||
|
(resolve, _reject) => {
|
||||||
|
setTimeout(resolve, timeout, []);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let records;
|
||||||
|
try {
|
||||||
|
records = await Promise.race([lookup, defaultFallback]);
|
||||||
|
} catch (reason) {
|
||||||
|
core.debug(`Error resolving SRV records: ${stringifyError(reason)}`);
|
||||||
|
records = [];
|
||||||
|
}
|
||||||
|
const acceptableRecords = records.filter((record) => {
|
||||||
|
for (const suffix of ALLOWED_SUFFIXES) {
|
||||||
|
if (record.name.endsWith(suffix)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
core.debug(
|
||||||
|
`Unacceptable domain due to an invalid suffix: ${record.name}`
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
if (acceptableRecords.length === 0) {
|
||||||
|
core.debug(`No records found for ${LOOKUP}`);
|
||||||
|
} else {
|
||||||
|
core.debug(
|
||||||
|
`Resolved ${LOOKUP} to ${JSON.stringify(acceptableRecords)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return acceptableRecords;
|
||||||
|
}
|
||||||
|
function orderRecordsByPriorityWeight(records) {
|
||||||
|
const byPriorityWeight = /* @__PURE__ */ new Map();
|
||||||
|
for (const record of records) {
|
||||||
|
const existing = byPriorityWeight.get(record.priority);
|
||||||
|
if (existing) {
|
||||||
|
existing.push(record);
|
||||||
|
} else {
|
||||||
|
byPriorityWeight.set(record.priority, [record]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const prioritizedRecords = [];
|
||||||
|
const keys = Array.from(byPriorityWeight.keys()).sort(
|
||||||
|
(a, b) => a - b
|
||||||
|
);
|
||||||
|
for (const priority of keys) {
|
||||||
|
const recordsByPrio = byPriorityWeight.get(priority);
|
||||||
|
if (recordsByPrio === void 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
prioritizedRecords.push(...weightedRandom(recordsByPrio));
|
||||||
|
}
|
||||||
|
return prioritizedRecords;
|
||||||
|
}
|
||||||
|
function weightedRandom(records) {
|
||||||
|
const scratchRecords = records.slice();
|
||||||
|
const result = [];
|
||||||
|
while (scratchRecords.length > 0) {
|
||||||
|
const weights = [];
|
||||||
|
{
|
||||||
|
for (let i = 0; i < scratchRecords.length; i++) {
|
||||||
|
weights.push(
|
||||||
|
scratchRecords[i].weight + (i > 0 ? scratchRecords[i - 1].weight : 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const point = Math.random() * weights[weights.length - 1];
|
||||||
|
for (let selectedIndex = 0; selectedIndex < weights.length; selectedIndex++) {
|
||||||
|
if (weights[selectedIndex] > point) {
|
||||||
|
result.push(scratchRecords.splice(selectedIndex, 1)[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// src/inputs.ts
|
// src/inputs.ts
|
||||||
var inputs_exports = {};
|
var inputs_exports = {};
|
||||||
__export(inputs_exports, {
|
__export(inputs_exports, {
|
||||||
|
@ -94197,21 +94385,6 @@ function noisilyGetInput(suffix, legacyPrefix) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// src/errors.ts
|
|
||||||
function stringifyError(e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
return e.message;
|
|
||||||
} else if (typeof e === "string") {
|
|
||||||
return e;
|
|
||||||
} else {
|
|
||||||
return JSON.stringify(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// src/index.ts
|
|
||||||
var DEFAULT_IDS_HOST = "https://install.determinate.systems";
|
|
||||||
var IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST;
|
|
||||||
var EVENT_EXCEPTION = "exception";
|
var EVENT_EXCEPTION = "exception";
|
||||||
var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit";
|
var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit";
|
||||||
var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss";
|
var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss";
|
||||||
|
@ -94245,6 +94418,13 @@ var DetSysAction = class {
|
||||||
}
|
}
|
||||||
constructor(actionOptions) {
|
constructor(actionOptions) {
|
||||||
this.actionOptions = makeOptionsConfident(actionOptions);
|
this.actionOptions = makeOptionsConfident(actionOptions);
|
||||||
|
this.idsHost = new IdsHost(
|
||||||
|
this.actionOptions.idsProjectName,
|
||||||
|
actionOptions.diagnosticsSuffix,
|
||||||
|
// Note: we don't use actionsCore.getInput('diagnostic-endpoint') on purpose:
|
||||||
|
// getInput silently converts absent data to an empty string.
|
||||||
|
process.env["INPUT_DIAGNOSTIC-ENDPOINT"]
|
||||||
|
);
|
||||||
this.exceptionAttachments = /* @__PURE__ */ new Map();
|
this.exceptionAttachments = /* @__PURE__ */ new Map();
|
||||||
this.nixStoreTrust = "unknown";
|
this.nixStoreTrust = "unknown";
|
||||||
this.strictMode = getBool("_internal-strict-mode");
|
this.strictMode = getBool("_internal-strict-mode");
|
||||||
|
@ -94256,9 +94436,9 @@ var DetSysAction = class {
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
beforeRetry: [
|
beforeRetry: [
|
||||||
(error2, retryCount) => {
|
(error3, retryCount) => {
|
||||||
core.info(
|
core.info(
|
||||||
`Retrying after error ${error2.code}, retry #: ${retryCount}`
|
`Retrying after error ${error3.code}, retry #: ${retryCount}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -94335,8 +94515,8 @@ var DetSysAction = class {
|
||||||
* Execute the Action as defined.
|
* Execute the Action as defined.
|
||||||
*/
|
*/
|
||||||
execute() {
|
execute() {
|
||||||
this.executeAsync().catch((error2) => {
|
this.executeAsync().catch((error3) => {
|
||||||
console.log(error2);
|
console.log(error3);
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -94347,8 +94527,8 @@ var DetSysAction = class {
|
||||||
addFact(key, value) {
|
addFact(key, value) {
|
||||||
this.facts[key] = value;
|
this.facts[key] = value;
|
||||||
}
|
}
|
||||||
getDiagnosticsUrl() {
|
async getDiagnosticsUrl() {
|
||||||
return this.actionOptions.diagnosticsUrl;
|
return await this.idsHost.getDiagnosticsUrl();
|
||||||
}
|
}
|
||||||
getUniqueId() {
|
getUniqueId() {
|
||||||
return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)();
|
return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)();
|
||||||
|
@ -94386,7 +94566,7 @@ var DetSysAction = class {
|
||||||
*/
|
*/
|
||||||
async fetchExecutable() {
|
async fetchExecutable() {
|
||||||
const binaryPath = await this.fetchArtifact();
|
const binaryPath = await this.fetchArtifact();
|
||||||
await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP);
|
await (0,external_node_fs_promises_namespaceObject.chmod)(binaryPath, external_node_fs_promises_namespaceObject.constants.S_IXUSR | external_node_fs_promises_namespaceObject.constants.S_IXGRP);
|
||||||
return binaryPath;
|
return binaryPath;
|
||||||
}
|
}
|
||||||
get isMain() {
|
get isMain() {
|
||||||
|
@ -94461,8 +94641,8 @@ var DetSysAction = class {
|
||||||
`Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}`
|
`Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}`
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
core.info(`Fetching from ${this.getSourceUrl()}`);
|
core.info(`Fetching from ${await this.getSourceUrl()}`);
|
||||||
const correlatedUrl = this.getSourceUrl();
|
const correlatedUrl = await this.getSourceUrl();
|
||||||
correlatedUrl.searchParams.set("ci", "github");
|
correlatedUrl.searchParams.set("ci", "github");
|
||||||
correlatedUrl.searchParams.set(
|
correlatedUrl.searchParams.set(
|
||||||
"correlation",
|
"correlation",
|
||||||
|
@ -94473,7 +94653,7 @@ var DetSysAction = class {
|
||||||
const v = versionCheckup.headers.etag;
|
const v = versionCheckup.headers.etag;
|
||||||
this.addFact(FACT_SOURCE_URL_ETAG, v);
|
this.addFact(FACT_SOURCE_URL_ETAG, v);
|
||||||
core.debug(
|
core.debug(
|
||||||
`Checking the tool cache for ${this.getSourceUrl()} at ${v}`
|
`Checking the tool cache for ${await this.getSourceUrl()} at ${v}`
|
||||||
);
|
);
|
||||||
const cached = await this.getCachedVersion(v);
|
const cached = await this.getCachedVersion(v);
|
||||||
if (cached) {
|
if (cached) {
|
||||||
|
@ -94521,13 +94701,13 @@ var DetSysAction = class {
|
||||||
this.recordEvent(`complete_${this.executionPhase}`);
|
this.recordEvent(`complete_${this.executionPhase}`);
|
||||||
await this.submitEvents();
|
await this.submitEvents();
|
||||||
}
|
}
|
||||||
getSourceUrl() {
|
async getSourceUrl() {
|
||||||
const p = this.sourceParameters;
|
const p = this.sourceParameters;
|
||||||
if (p.url) {
|
if (p.url) {
|
||||||
this.addFact(FACT_SOURCE_URL, p.url);
|
this.addFact(FACT_SOURCE_URL, p.url);
|
||||||
return new URL(p.url);
|
return new URL(p.url);
|
||||||
}
|
}
|
||||||
const fetchUrl = new URL(IDS_HOST);
|
const fetchUrl = await this.idsHost.getRootUrl();
|
||||||
fetchUrl.pathname += this.actionOptions.idsProjectName;
|
fetchUrl.pathname += this.actionOptions.idsProjectName;
|
||||||
if (p.tag) {
|
if (p.tag) {
|
||||||
fetchUrl.pathname += `/tag/${p.tag}`;
|
fetchUrl.pathname += `/tag/${p.tag}`;
|
||||||
|
@ -94552,7 +94732,7 @@ var DetSysAction = class {
|
||||||
const startCwd = process.cwd();
|
const startCwd = process.cwd();
|
||||||
try {
|
try {
|
||||||
const tempDir = this.getTemporaryName();
|
const tempDir = this.getTemporaryName();
|
||||||
await (0,promises_namespaceObject.mkdir)(tempDir);
|
await (0,external_node_fs_promises_namespaceObject.mkdir)(tempDir);
|
||||||
process.chdir(tempDir);
|
process.chdir(tempDir);
|
||||||
process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE;
|
process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE;
|
||||||
delete process.env.GITHUB_WORKSPACE;
|
delete process.env.GITHUB_WORKSPACE;
|
||||||
|
@ -94578,9 +94758,9 @@ var DetSysAction = class {
|
||||||
const startCwd = process.cwd();
|
const startCwd = process.cwd();
|
||||||
try {
|
try {
|
||||||
const tempDir = this.getTemporaryName();
|
const tempDir = this.getTemporaryName();
|
||||||
await (0,promises_namespaceObject.mkdir)(tempDir);
|
await (0,external_node_fs_promises_namespaceObject.mkdir)(tempDir);
|
||||||
process.chdir(tempDir);
|
process.chdir(tempDir);
|
||||||
await (0,promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`);
|
await (0,external_node_fs_promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`);
|
||||||
process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE;
|
process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE;
|
||||||
delete process.env.GITHUB_WORKSPACE;
|
delete process.env.GITHUB_WORKSPACE;
|
||||||
await cache.saveCache(
|
await cache.saveCache(
|
||||||
|
@ -94602,7 +94782,7 @@ var DetSysAction = class {
|
||||||
for (const location of pathParts) {
|
for (const location of pathParts) {
|
||||||
const candidateNix = external_node_path_namespaceObject.join(location, "nix");
|
const candidateNix = external_node_path_namespaceObject.join(location, "nix");
|
||||||
try {
|
try {
|
||||||
await promises_namespaceObject.access(candidateNix, promises_namespaceObject.constants.X_OK);
|
await external_node_fs_promises_namespaceObject.access(candidateNix, external_node_fs_promises_namespaceObject.constants.X_OK);
|
||||||
core.debug(`Found Nix at ${candidateNix}`);
|
core.debug(`Found Nix at ${candidateNix}`);
|
||||||
nixLocation = candidateNix;
|
nixLocation = candidateNix;
|
||||||
break;
|
break;
|
||||||
|
@ -94683,7 +94863,8 @@ var DetSysAction = class {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async submitEvents() {
|
async submitEvents() {
|
||||||
if (this.actionOptions.diagnosticsUrl === void 0) {
|
const diagnosticsUrl = await this.idsHost.getDiagnosticsUrl();
|
||||||
|
if (diagnosticsUrl === void 0) {
|
||||||
core.debug(
|
core.debug(
|
||||||
"Diagnostics are disabled. Not sending the following events:"
|
"Diagnostics are disabled. Not sending the following events:"
|
||||||
);
|
);
|
||||||
|
@ -94696,7 +94877,7 @@ var DetSysAction = class {
|
||||||
events: this.events
|
events: this.events
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
await this.client.post(this.actionOptions.diagnosticsUrl, {
|
await this.client.post(diagnosticsUrl, {
|
||||||
json: batch,
|
json: batch,
|
||||||
timeout: {
|
timeout: {
|
||||||
request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS
|
request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS
|
||||||
|
@ -94706,12 +94887,28 @@ var DetSysAction = class {
|
||||||
core.debug(
|
core.debug(
|
||||||
`Error submitting diagnostics event: ${stringifyError2(e)}`
|
`Error submitting diagnostics event: ${stringifyError2(e)}`
|
||||||
);
|
);
|
||||||
|
this.idsHost.markCurrentHostBroken();
|
||||||
|
const secondaryDiagnosticsUrl = await this.idsHost.getDiagnosticsUrl();
|
||||||
|
if (secondaryDiagnosticsUrl !== void 0) {
|
||||||
|
try {
|
||||||
|
await this.client.post(secondaryDiagnosticsUrl, {
|
||||||
|
json: batch,
|
||||||
|
timeout: {
|
||||||
|
request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
core.debug(
|
||||||
|
`Error submitting diagnostics event to secondary host (${secondaryDiagnosticsUrl}): ${stringifyError2(err)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.events = [];
|
this.events = [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function stringifyError2(error2) {
|
function stringifyError2(error3) {
|
||||||
return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2);
|
return error3 instanceof Error || typeof error3 == "string" ? error3.toString() : JSON.stringify(error3);
|
||||||
}
|
}
|
||||||
function makeOptionsConfident(actionOptions) {
|
function makeOptionsConfident(actionOptions) {
|
||||||
const idsProjectName = actionOptions.idsProjectName ?? actionOptions.name;
|
const idsProjectName = actionOptions.idsProjectName ?? actionOptions.name;
|
||||||
|
@ -94721,72 +94918,12 @@ function makeOptionsConfident(actionOptions) {
|
||||||
eventPrefix: actionOptions.eventPrefix || "action:",
|
eventPrefix: actionOptions.eventPrefix || "action:",
|
||||||
fetchStyle: actionOptions.fetchStyle,
|
fetchStyle: actionOptions.fetchStyle,
|
||||||
legacySourcePrefix: actionOptions.legacySourcePrefix,
|
legacySourcePrefix: actionOptions.legacySourcePrefix,
|
||||||
requireNix: actionOptions.requireNix,
|
requireNix: actionOptions.requireNix
|
||||||
diagnosticsUrl: determineDiagnosticsUrl(
|
|
||||||
idsProjectName,
|
|
||||||
actionOptions.diagnosticsUrl
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
core.debug("idslib options:");
|
core.debug("idslib options:");
|
||||||
core.debug(JSON.stringify(finalOpts, void 0, 2));
|
core.debug(JSON.stringify(finalOpts, void 0, 2));
|
||||||
return finalOpts;
|
return finalOpts;
|
||||||
}
|
}
|
||||||
function determineDiagnosticsUrl(idsProjectName, urlOption) {
|
|
||||||
if (urlOption === null) {
|
|
||||||
return void 0;
|
|
||||||
}
|
|
||||||
if (urlOption !== void 0) {
|
|
||||||
return urlOption;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const providedDiagnosticEndpoint = process.env["INPUT_DIAGNOSTIC-ENDPOINT"];
|
|
||||||
if (providedDiagnosticEndpoint === "") {
|
|
||||||
return void 0;
|
|
||||||
}
|
|
||||||
if (providedDiagnosticEndpoint !== void 0) {
|
|
||||||
try {
|
|
||||||
return mungeDiagnosticEndpoint(new URL(providedDiagnosticEndpoint));
|
|
||||||
} catch (e) {
|
|
||||||
core.info(
|
|
||||||
`User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const diagnosticUrl = new URL(IDS_HOST);
|
|
||||||
diagnosticUrl.pathname += idsProjectName;
|
|
||||||
diagnosticUrl.pathname += "/diagnostics";
|
|
||||||
return diagnosticUrl;
|
|
||||||
} catch (e) {
|
|
||||||
core.info(
|
|
||||||
`Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return void 0;
|
|
||||||
}
|
|
||||||
function mungeDiagnosticEndpoint(inputUrl) {
|
|
||||||
if (DEFAULT_IDS_HOST === IDS_HOST) {
|
|
||||||
return inputUrl;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const defaultIdsHost = new URL(DEFAULT_IDS_HOST);
|
|
||||||
const currentIdsHost = new URL(IDS_HOST);
|
|
||||||
if (inputUrl.origin !== defaultIdsHost.origin) {
|
|
||||||
return inputUrl;
|
|
||||||
}
|
|
||||||
inputUrl.protocol = currentIdsHost.protocol;
|
|
||||||
inputUrl.host = currentIdsHost.host;
|
|
||||||
inputUrl.username = currentIdsHost.username;
|
|
||||||
inputUrl.password = currentIdsHost.password;
|
|
||||||
return inputUrl;
|
|
||||||
} catch (e) {
|
|
||||||
core.info(
|
|
||||||
`Default or overridden IDS host isn't a valid URL: ${stringifyError2(e)}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return inputUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* linux-release-info
|
* linux-release-info
|
||||||
|
|
|
@ -13,7 +13,7 @@ dependencies:
|
||||||
version: 1.1.1
|
version: 1.1.1
|
||||||
detsys-ts:
|
detsys-ts:
|
||||||
specifier: github:DeterminateSystems/detsys-ts
|
specifier: github:DeterminateSystems/detsys-ts
|
||||||
version: github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d
|
version: github.com/DeterminateSystems/detsys-ts/9d66d2c89c150f796165fdcc20b3be538807c0f4
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@trivago/prettier-plugin-sort-imports':
|
'@trivago/prettier-plugin-sort-imports':
|
||||||
|
@ -329,7 +329,7 @@ packages:
|
||||||
'@babel/helper-split-export-declaration': 7.24.6
|
'@babel/helper-split-export-declaration': 7.24.6
|
||||||
'@babel/parser': 7.24.6
|
'@babel/parser': 7.24.6
|
||||||
'@babel/types': 7.24.6
|
'@babel/types': 7.24.6
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
globals: 11.12.0
|
globals: 11.12.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
@ -786,7 +786,7 @@ packages:
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dependencies:
|
dependencies:
|
||||||
ajv: 6.12.6
|
ajv: 6.12.6
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
espree: 9.6.1
|
espree: 9.6.1
|
||||||
globals: 13.24.0
|
globals: 13.24.0
|
||||||
ignore: 5.3.1
|
ignore: 5.3.1
|
||||||
|
@ -817,7 +817,7 @@ packages:
|
||||||
engines: {node: '>=10.10.0'}
|
engines: {node: '>=10.10.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@humanwhocodes/object-schema': 2.0.3
|
'@humanwhocodes/object-schema': 2.0.3
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
minimatch: 3.1.2
|
minimatch: 3.1.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
@ -1159,7 +1159,7 @@ packages:
|
||||||
'@typescript-eslint/types': 7.11.0
|
'@typescript-eslint/types': 7.11.0
|
||||||
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
|
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
|
||||||
'@typescript-eslint/visitor-keys': 7.11.0
|
'@typescript-eslint/visitor-keys': 7.11.0
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
eslint: 8.57.0
|
eslint: 8.57.0
|
||||||
typescript: 5.4.5
|
typescript: 5.4.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
|
@ -1186,7 +1186,7 @@ packages:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
|
'@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
|
||||||
'@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
|
'@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
eslint: 8.57.0
|
eslint: 8.57.0
|
||||||
ts-api-utils: 1.3.0(typescript@5.4.5)
|
ts-api-utils: 1.3.0(typescript@5.4.5)
|
||||||
typescript: 5.4.5
|
typescript: 5.4.5
|
||||||
|
@ -1210,7 +1210,7 @@ packages:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 7.11.0
|
'@typescript-eslint/types': 7.11.0
|
||||||
'@typescript-eslint/visitor-keys': 7.11.0
|
'@typescript-eslint/visitor-keys': 7.11.0
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
globby: 11.1.0
|
globby: 11.1.0
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
minimatch: 9.0.4
|
minimatch: 9.0.4
|
||||||
|
@ -1518,7 +1518,7 @@ packages:
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite: 1.0.30001625
|
caniuse-lite: 1.0.30001625
|
||||||
electron-to-chromium: 1.4.784
|
electron-to-chromium: 1.4.787
|
||||||
node-releases: 2.0.14
|
node-releases: 2.0.14
|
||||||
update-browserslist-db: 1.0.16(browserslist@4.23.0)
|
update-browserslist-db: 1.0.16(browserslist@4.23.0)
|
||||||
dev: true
|
dev: true
|
||||||
|
@ -1718,8 +1718,8 @@ packages:
|
||||||
ms: 2.1.3
|
ms: 2.1.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/debug@4.3.4:
|
/debug@4.3.5:
|
||||||
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==}
|
||||||
engines: {node: '>=6.0'}
|
engines: {node: '>=6.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
supports-color: '*'
|
supports-color: '*'
|
||||||
|
@ -1811,8 +1811,8 @@ packages:
|
||||||
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
|
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/electron-to-chromium@1.4.784:
|
/electron-to-chromium@1.4.787:
|
||||||
resolution: {integrity: sha512-9CZwh+sDrhDAeOEFh8s3PqwduzTyYIeYwZolc1b9ENAUt3ePu7R1sJSCWr/820ISssRxCJUyHI9Wb7j+0Uo1AA==}
|
resolution: {integrity: sha512-d0EFmtLPjctczO3LogReyM2pbBiiZbnsKnGF+cdZhsYzHm/A0GV7W94kqzLD8SN4O3f3iHlgLUChqghgyznvCQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/emoji-regex@8.0.0:
|
/emoji-regex@8.0.0:
|
||||||
|
@ -2049,7 +2049,7 @@ packages:
|
||||||
eslint: '*'
|
eslint: '*'
|
||||||
eslint-plugin-import: '*'
|
eslint-plugin-import: '*'
|
||||||
dependencies:
|
dependencies:
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
enhanced-resolve: 5.16.1
|
enhanced-resolve: 5.16.1
|
||||||
eslint: 8.57.0
|
eslint: 8.57.0
|
||||||
eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
|
eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
|
||||||
|
@ -2287,7 +2287,7 @@ packages:
|
||||||
ajv: 6.12.6
|
ajv: 6.12.6
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
cross-spawn: 7.0.3
|
cross-spawn: 7.0.3
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
doctrine: 3.0.0
|
doctrine: 3.0.0
|
||||||
escape-string-regexp: 4.0.0
|
escape-string-regexp: 4.0.0
|
||||||
eslint-scope: 7.2.2
|
eslint-scope: 7.2.2
|
||||||
|
@ -4061,7 +4061,7 @@ packages:
|
||||||
bundle-require: 4.1.0(esbuild@0.19.12)
|
bundle-require: 4.1.0(esbuild@0.19.12)
|
||||||
cac: 6.7.14
|
cac: 6.7.14
|
||||||
chokidar: 3.6.0
|
chokidar: 3.6.0
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
esbuild: 0.19.12
|
esbuild: 0.19.12
|
||||||
execa: 5.1.1
|
execa: 5.1.1
|
||||||
globby: 11.1.0
|
globby: 11.1.0
|
||||||
|
@ -4208,7 +4208,7 @@ packages:
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
cac: 6.7.14
|
cac: 6.7.14
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
pathe: 1.1.2
|
pathe: 1.1.2
|
||||||
picocolors: 1.0.1
|
picocolors: 1.0.1
|
||||||
vite: 5.2.12
|
vite: 5.2.12
|
||||||
|
@ -4290,7 +4290,7 @@ packages:
|
||||||
'@vitest/utils': 1.6.0
|
'@vitest/utils': 1.6.0
|
||||||
acorn-walk: 8.3.2
|
acorn-walk: 8.3.2
|
||||||
chai: 4.4.1
|
chai: 4.4.1
|
||||||
debug: 4.3.4
|
debug: 4.3.5
|
||||||
execa: 8.0.1
|
execa: 8.0.1
|
||||||
local-pkg: 0.5.0
|
local-pkg: 0.5.0
|
||||||
magic-string: 0.30.10
|
magic-string: 0.30.10
|
||||||
|
@ -4458,8 +4458,8 @@ packages:
|
||||||
engines: {node: '>=12.20'}
|
engines: {node: '>=12.20'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d:
|
github.com/DeterminateSystems/detsys-ts/9d66d2c89c150f796165fdcc20b3be538807c0f4:
|
||||||
resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/5fcb0532d85556ebc2de286e483885976531339d}
|
resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/9d66d2c89c150f796165fdcc20b3be538807c0f4}
|
||||||
name: detsys-ts
|
name: detsys-ts
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
Loading…
Reference in a new issue