From 37b6ead477367ca88f102ce538f40c0a3c84f0b5 Mon Sep 17 00:00:00 2001 From: Marco Gario Date: Thu, 27 Jun 2024 16:24:26 +0000 Subject: [PATCH] Better handling for required workflows Return the workflow path from the run rather than trying to fetch the workflow information when the workflow information is missing or refers to a required workflow. --- lib/api-client.js | 7 +++++++ lib/api-client.js.map | 2 +- src/api-client.ts | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/api-client.js b/lib/api-client.js index fe5fa12d5..4e0c8b615 100644 --- a/lib/api-client.js +++ b/lib/api-client.js @@ -123,6 +123,13 @@ async function getWorkflowRelativePath() { run_id, }); const workflowUrl = runsResponse.data.workflow_url; + const requiredWorkflowRegex = /\/repos\/[^/]+\/[^/]+\/actions\/required_workflows\/[^/]+/; + if (!workflowUrl || workflowUrl === "" || requiredWorkflowRegex.test(workflowUrl)) { + // For required workflows, the workflowUrl is invalid so we cannot fetch more informations + // about the workflow. + // However, the path is available in the original response. + return runsResponse.data.path; + } const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); return workflowResponse.data.path; } diff --git a/lib/api-client.js.map b/lib/api-client.js.map index 5fc36d0e6..50dc075e9 100644 --- a/lib/api-client.js.map +++ b/lib/api-client.js.map @@ -1 +1 @@ -{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,sCAMC;AAED,oCAEC;AAED,oEAIC;AAID,0DA0BC;AASD,4CAQC;AAKD,0DAoBC;AASD,wCAcC;AAED,0CAKC;AAED,kDAqBC;AAUD,8CAiBC;AAGD,gDAUC;AAED,8DAWC;AA1PD,oDAAsC;AACtC,uEAAyD;AACzD,6DAA+C;AAC/C,0EAAgD;AAEhD,iDAAoE;AACpE,6CAAkD;AAClD,iCASgB;AAEhB,MAAM,gCAAgC,GAAG,6BAA6B,CAAC;AAEvE,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,+FAAc,CA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,kBAAW,EAAC,CAAC,CAAC,EAAE,CAAC;QACnB,IACE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,kDAAkD,CAAC;YACtE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YACtC,uCAAuC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EACvD,CAAC;YACD,OAAO,IAAI,yBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,sCAMC;AAED,oCAEC;AAED,oEAIC;AAID,0DA0BC;AASD,4CAQC;AAKD,0DA4BC;AASD,wCAcC;AAED,0CAKC;AAED,kDAqBC;AAUD,8CAiBC;AAGD,gDAUC;AAED,8DAWC;AAlQD,oDAAsC;AACtC,uEAAyD;AACzD,6DAA+C;AAC/C,0EAAgD;AAEhD,iDAAoE;AACpE,6CAAkD;AAClD,iCASgB;AAEhB,MAAM,gCAAgC,GAAG,6BAA6B,CAAC;AAEvE,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,+FAAc,CAAA;IACd,+FAAc,CAAA;AAChB,CAAC,EAHW,0BAA0B,0CAA1B,0BAA0B,QAGrC;AAiBD,SAAS,0BAA0B,CACjC,UAAoC,EACpC,EAAE,aAAa,GAAG,KAAK,EAAE,GAAG,EAAE;IAE9B,MAAM,IAAI,GACR,CAAC,aAAa,IAAI,UAAU,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC;IACpE,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,OAAO,IAAI,eAAe,CACxB,WAAW,CAAC,iBAAiB,CAAC,IAAI,EAAE;QAClC,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AAuC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EACvD,CAAC;YACD,OAAO,IAAI,yBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/src/api-client.ts b/src/api-client.ts index d95e70104..a1e7c36dd 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -139,6 +139,14 @@ export async function getWorkflowRelativePath(): Promise { ); const workflowUrl = runsResponse.data.workflow_url; + const requiredWorkflowRegex = /\/repos\/[^/]+\/[^/]+\/actions\/required_workflows\/[^/]+/; + if (!workflowUrl || workflowUrl === "" || requiredWorkflowRegex.test(workflowUrl)) { + // For required workflows, the workflowUrl is invalid so we cannot fetch more informations + // about the workflow. + // However, the path is available in the original response. + return runsResponse.data.path as string; + } + const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); return workflowResponse.data.path as string;