mirror of
https://github.com/github/codeql-action.git
synced 2026-05-04 12:50:14 +00:00
Refactor: remove argument array indirection and pass directly instead
This commit is contained in:
Generated
+3
-9
@@ -197,17 +197,11 @@ async function uploadDebugArtifacts(toUpload, rootDir, artifactName, ghVariant,
|
||||
(await features.getValue(feature_flags_1.Feature.ArtifactUpgrade))
|
||||
? new artifact.DefaultArtifactClient()
|
||||
: artifactLegacy.create();
|
||||
const artifactUploaderArgs = [
|
||||
sanitizeArtifactName(`${artifactName}${suffix}`),
|
||||
toUpload.map((file) => path.normalize(file)),
|
||||
path.normalize(rootDir),
|
||||
{
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(sanitizeArtifactName(`${artifactName}${suffix}`), toUpload.map((file) => path.normalize(file)), path.normalize(rootDir), {
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
];
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
|
||||
File diff suppressed because one or more lines are too long
Generated
+4
-10
@@ -68,16 +68,10 @@ async function runWrapper() {
|
||||
(await features.getValue(feature_flags_1.Feature.ArtifactUpgrade))
|
||||
? new artifact.DefaultArtifactClient()
|
||||
: artifactLegacy.create();
|
||||
const artifactUploaderArgs = [
|
||||
"proxy-log-file",
|
||||
[logFilePath],
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
{
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
];
|
||||
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
|
||||
await artifactUploader.uploadArtifact("proxy-log-file", [logFilePath], actionsUtil.getTemporaryDirectory(), {
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"start-proxy-action-post.js","sourceRoot":"","sources":["../src/start-proxy-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,4DAA8C;AAC9C,yEAA2D;AAC3D,oDAAsC;AAEtC,4DAA8C;AAC9C,6CAAgD;AAChD,4DAA8C;AAC9C,mDAAoD;AACpD,uCAA6C;AAC7C,6CAAkD;AAClD,iCAKgB;AAEhB,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC/C,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,wCAAwC,IAAA,sBAAe,EAAC,KAAK,CAAC,EAAE,CACjE,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,CACxC,WAAW,CAAC,qBAAqB,EAAE,EACnC,IAAI,CACL,CAAC;IAEF,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,CACP,wEAAwE,CACzE,CAAC;QACF,IAAI,MAAM,EAAE,aAAa,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,OAAO,CACV,qFAAqF,CACtF,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;QAClC,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;QAC/C,IAAA,gCAAyB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,aAAa,GAAG,IAAA,+BAAkB,EACtC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CACzC,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,wBAAQ,CAC3B,aAAa,EACb,aAAa,EACb,WAAW,CAAC,qBAAqB,EAAE,EACnC,MAAM,CACP,CAAC;QAEF,IAAI,CAAC;YACH,+GAA+G;YAC/G,uGAAuG;YACvG,MAAM,gBAAgB,GACpB,MAAM,EAAE,aAAa,CAAC,IAAI,KAAK,oBAAa,CAAC,IAAI;gBACjD,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,uBAAO,CAAC,eAAe,CAAC,CAAC;gBAChD,CAAC,CAAC,IAAI,QAAQ,CAAC,qBAAqB,EAAE;gBACtC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;YAE9B,MAAM,oBAAoB,GAKtB;gBACF,gBAAgB;gBAChB,CAAC,WAAW,CAAC;gBACb,WAAW,CAAC,qBAAqB,EAAE;gBACnC;oBACE,wFAAwF;oBACxF,aAAa,EAAE,CAAC;iBACjB;aACF,CAAC;YAEF,MAAM,gBAAgB,CAAC,cAAc,CAAC,GAAG,oBAAoB,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,yEAAyE;YACzE,IAAI,CAAC,OAAO,CAAC,qCAAqC,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||
{"version":3,"file":"start-proxy-action-post.js","sourceRoot":"","sources":["../src/start-proxy-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,4DAA8C;AAC9C,yEAA2D;AAC3D,oDAAsC;AAEtC,4DAA8C;AAC9C,6CAAgD;AAChD,4DAA8C;AAC9C,mDAAoD;AACpD,uCAA6C;AAC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YACH,+GAA+G;YAC/G,uGAAuG;YACvG,MAAM,gBAAgB,GACpB,MAAM,EAAE,aAAa,CAAC,IAAI,KAAK,oBAAa,CAAC,IAAI;gBACjD,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,uBAAO,CAAC,eAAe,CAAC,CAAC;gBAChD,CAAC,CAAC,IAAI,QAAQ,CAAC,qBAAqB,EAAE;gBACtC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;YAE9B,MAAM,gBAAgB,CAAC,cAAc,CACnC,gBAAgB,EAChB,CAAC,WAAW,CAAC,EACb,WAAW,CAAC,qBAAqB,EAAE,EACnC;gBACE,wFAAwF;gBACxF,aAAa,EAAE,CAAC;aACjB,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,yEAAyE;YACzE,IAAI,CAAC,OAAO,CAAC,qCAAqC,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||
+9
-16
@@ -268,23 +268,16 @@ export async function uploadDebugArtifacts(
|
||||
? new artifact.DefaultArtifactClient()
|
||||
: artifactLegacy.create();
|
||||
|
||||
const artifactUploaderArgs: [
|
||||
string, // artifact name
|
||||
string[], // file paths to upload
|
||||
string, // root directory
|
||||
artifact.UploadArtifactOptions,
|
||||
] = [
|
||||
sanitizeArtifactName(`${artifactName}${suffix}`),
|
||||
toUpload.map((file) => path.normalize(file)),
|
||||
path.normalize(rootDir),
|
||||
{
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
];
|
||||
|
||||
try {
|
||||
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
|
||||
await artifactUploader.uploadArtifact(
|
||||
sanitizeArtifactName(`${artifactName}${suffix}`),
|
||||
toUpload.map((file) => path.normalize(file)),
|
||||
path.normalize(rootDir),
|
||||
{
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
core.warning(`Failed to upload debug artifacts: ${e}`);
|
||||
|
||||
@@ -70,12 +70,7 @@ async function runWrapper() {
|
||||
? new artifact.DefaultArtifactClient()
|
||||
: artifactLegacy.create();
|
||||
|
||||
const artifactUploaderArgs: [
|
||||
string, // artifact name
|
||||
string[], // file paths to upload
|
||||
string, // root directory
|
||||
artifact.UploadArtifactOptions,
|
||||
] = [
|
||||
await artifactUploader.uploadArtifact(
|
||||
"proxy-log-file",
|
||||
[logFilePath],
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
@@ -83,9 +78,7 @@ async function runWrapper() {
|
||||
// ensure we don't keep the debug artifacts around for too long since they can be large.
|
||||
retentionDays: 7,
|
||||
},
|
||||
];
|
||||
|
||||
await artifactUploader.uploadArtifact(...artifactUploaderArgs);
|
||||
);
|
||||
} catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
core.warning(`Failed to upload debug artifacts: ${e}`);
|
||||
|
||||
Reference in New Issue
Block a user