@@ -845,11 +845,12 @@ class CreateArtifactRequest$Type extends runtime_5.MessageType {
845845 { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
846846 { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
847847 { no: 4, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp },
848- { no: 5, name: "version", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
848+ { no: 5, name: "version", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
849+ { no: 6, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
849850 ]);
850851 }
851852 create(value) {
852- const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 };
853+ const message = { runId: "", workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 };
853854 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
854855 if (value !== undefined)
855856 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -978,10 +979,11 @@ class FinalizeArtifactRequest$Type extends runtime_5.MessageType {
978979 { no: 5, name: "hash", kind: "message", T: () => wrappers_2.StringValue },
979980 { no: 6, name: "etag", kind: "scalar", T: 9 },
980981 { no: 6, name: "upload_id", kind: "scalar", T: 9 },
982+ { no: 8, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
981983 ]);
982984 }
983985 create(value) {
984- const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: "0", etag: "", uploadId: "" };
986+ const message = { runId: "", workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: "0", etag: "", uploadId: "" };
985987 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
986988 if (value !== undefined)
987989 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -1106,11 +1108,12 @@ class ListArtifactsRequest$Type extends runtime_5.MessageType {
11061108 { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
11071109 { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
11081110 { no: 3, name: "name_filter", kind: "message", T: () => wrappers_2.StringValue },
1109- { no: 4, name: "id_filter", kind: "message", T: () => wrappers_1.Int64Value }
1111+ { no: 4, name: "id_filter", kind: "message", T: () => wrappers_1.Int64Value },
1112+ { no: 5, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
11101113 ]);
11111114 }
11121115 create(value) {
1113- const message = { workflowRunBackendId: "", workflowJobRunBackendId: "" };
1116+ const message = { runId: "", workflowRunBackendId: "", workflowJobRunBackendId: "" };
11141117 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
11151118 if (value !== undefined)
11161119 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -1223,11 +1226,12 @@ class ListArtifactsResponse_MonolithArtifact$Type extends runtime_5.MessageType
12231226 { no: 3, name: "database_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
12241227 { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12251228 { no: 5, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
1226- { no: 6, name: "created_at", kind: "message", T: () => timestamp_1.Timestamp }
1229+ { no: 6, name: "created_at", kind: "message", T: () => timestamp_1.Timestamp },
1230+ { no: 7, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12271231 ]);
12281232 }
12291233 create(value) {
1230- const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", databaseId: "0", name: "", size: "0" };
1234+ const message = { runId: "", workflowRunBackendId: "", workflowJobRunBackendId: "", databaseId: "0", name: "", size: "0" };
12311235 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
12321236 if (value !== undefined)
12331237 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -1302,11 +1306,12 @@ class GetSignedArtifactURLRequest$Type extends runtime_5.MessageType {
13021306 super("github.actions.results.api.v1.GetSignedArtifactURLRequest", [
13031307 { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
13041308 { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1305- { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1309+ { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1310+ { no: 4, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
13061311 ]);
13071312 }
13081313 create(value) {
1309- const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" };
1314+ const message = { runId: "", workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" };
13101315 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
13111316 if (value !== undefined)
13121317 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -1410,11 +1415,12 @@ class DeleteArtifactRequest$Type extends runtime_5.MessageType {
14101415 super("github.actions.results.api.v1.DeleteArtifactRequest", [
14111416 { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
14121417 { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1413- { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1418+ { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1419+ { no: 4, name: "run_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
14141420 ]);
14151421 }
14161422 create(value) {
1417- const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" };
1423+ const message = { runId: "", workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" };
14181424 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
14191425 if (value !== undefined)
14201426 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -2257,8 +2263,9 @@ exports.deleteArtifactPublic = deleteArtifactPublic;
22572263function deleteArtifactInternal(artifactName) {
22582264 return __awaiter(this, void 0, void 0, function* () {
22592265 const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)();
2260- const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
2266+ const { publicRunId, workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
22612267 const listReq = {
2268+ runId: publicRunId,
22622269 workflowRunBackendId,
22632270 workflowJobRunBackendId,
22642271 nameFilter: generated_1.StringValue.create({ value: artifactName })
@@ -2273,6 +2280,7 @@ function deleteArtifactInternal(artifactName) {
22732280 (0, core_1.debug)(`More than one artifact found for a single name, returning newest (id: ${artifact.databaseId})`);
22742281 }
22752282 const req = {
2283+ runId: publicRunId,
22762284 workflowRunBackendId: artifact.workflowRunBackendId,
22772285 workflowJobRunBackendId: artifact.workflowJobRunBackendId,
22782286 name: artifact.name
@@ -2500,8 +2508,9 @@ function downloadArtifactInternal(artifactId, options) {
25002508 return __awaiter(this, void 0, void 0, function* () {
25012509 const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path);
25022510 const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)();
2503- const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
2511+ const { publicRunId, workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
25042512 const listReq = {
2513+ runId: publicRunId,
25052514 workflowRunBackendId,
25062515 workflowJobRunBackendId,
25072516 idFilter: generated_1.Int64Value.create({ value: artifactId.toString() })
@@ -2514,6 +2523,7 @@ function downloadArtifactInternal(artifactId, options) {
25142523 core.warning('Multiple artifacts found, defaulting to first.');
25152524 }
25162525 const signedReq = {
2526+ runId: artifacts[0].runId,
25172527 workflowRunBackendId: artifacts[0].workflowRunBackendId,
25182528 workflowJobRunBackendId: artifacts[0].workflowJobRunBackendId,
25192529 name: artifacts[0].name
@@ -2643,8 +2653,9 @@ exports.getArtifactPublic = getArtifactPublic;
26432653function getArtifactInternal(artifactName) {
26442654 return __awaiter(this, void 0, void 0, function* () {
26452655 const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)();
2646- const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
2656+ const { publicRunId, workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
26472657 const req = {
2658+ runId: publicRunId,
26482659 workflowRunBackendId,
26492660 workflowJobRunBackendId,
26502661 nameFilter: generated_1.StringValue.create({ value: artifactName })
@@ -2778,8 +2789,9 @@ exports.listArtifactsPublic = listArtifactsPublic;
27782789function listArtifactsInternal(latest = false) {
27792790 return __awaiter(this, void 0, void 0, function* () {
27802791 const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)();
2781- const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
2792+ const { publicRunId, workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)();
27822793 const req = {
2794+ runId: publicRunId,
27832795 workflowRunBackendId,
27842796 workflowJobRunBackendId
27852797 };
@@ -3345,9 +3357,14 @@ function getBackendIdsFromToken() {
33453357 // missing expected number of claims
33463358 throw InvalidJwtError;
33473359 }
3360+ const publicRunId = process.env["GITHUB_JOB"];
3361+ if (publicRunId == null) {
3362+ throw new Error("failed to get GITHUB_JOB environment variable");
3363+ }
33483364 const ids = {
33493365 workflowRunBackendId: scopeParts[1],
3350- workflowJobRunBackendId: scopeParts[2]
3366+ workflowJobRunBackendId: scopeParts[2],
3367+ publicRunId: publicRunId,
33513368 };
33523369 core.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`);
33533370 core.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`);
@@ -3682,6 +3699,7 @@ function uploadArtifact(name, files, rootDirectory, options) {
36823699 const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)();
36833700 // create the artifact
36843701 const createArtifactReq = {
3702+ runId: backendIds.publicRunId,
36853703 workflowRunBackendId: backendIds.workflowRunBackendId,
36863704 workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
36873705 name,
@@ -3701,6 +3719,7 @@ function uploadArtifact(name, files, rootDirectory, options) {
37013719 const uploadResult = yield (0, blob_upload_1.uploadZipToBlobStorage)(createArtifactResp.signedUploadUrl, zipUploadStream);
37023720 // finalize the artifact
37033721 const finalizeArtifactReq = {
3722+ runId: backendIds.publicRunId,
37043723 workflowRunBackendId: backendIds.workflowRunBackendId,
37053724 workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
37063725 name,
0 commit comments