only check nwo of supported actions

This commit is contained in:
Nick Fyson
2021-09-08 10:28:14 +01:00
parent 7aa1944311
commit c2cc54a69e
+3 -2
View File
@@ -58,7 +58,7 @@ async function checkWorkflows(
const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false;
const enabled = const enabled =
!isPartnerWorkflow && !isPartnerWorkflow &&
(await checkWorkflow(workflowFilePath, enabledActions)); (await checkWorkflow(workflowFilePath, enabledActions));
const workflowDesc: WorkflowDesc = { const workflowDesc: WorkflowDesc = {
@@ -104,7 +104,8 @@ async function checkWorkflow(
if (!!step.uses) { if (!!step.uses) {
// Check if allowed action // Check if allowed action
const [actionName, _] = step.uses.split("@"); const [actionName, _] = step.uses.split("@");
if (!enabledActionsSet.has(actionName.toLowerCase())) { const actionNwo = actionName.split("/").slice(0, 2).join("/");
if (!enabledActionsSet.has(actionNwo.toLowerCase())) {
console.info( console.info(
`Workflow ${workflowPath} uses '${actionName}' which is not supported for GHES.` `Workflow ${workflowPath} uses '${actionName}' which is not supported for GHES.`
); );