diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index e37eca3..9edc70e 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -45,7 +45,7 @@ async function checkWorkflows( }); for (const e of dir) { - if (e.isFile()) { + if (e.isFile() && extname(e.name) === ".yml") { const workflowFilePath = join(folder, e.name); const workflowId = basename(e.name, extname(e.name)); const workflowProperties: WorkflowProperties = require(join( @@ -58,7 +58,7 @@ async function checkWorkflows( const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; const enabled = - !isPartnerWorkflow && + !isPartnerWorkflow && (await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = { @@ -104,7 +104,8 @@ async function checkWorkflow( if (!!step.uses) { // Check if allowed action 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( `Workflow ${workflowPath} uses '${actionName}' which is not supported for GHES.` ); diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index eef1700..e4f50fa 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -2,7 +2,8 @@ "folders": [ "../../ci", "../../automation", - "../../deployments" + "../../deployments", + "../../code-scanning" ], "enabledActions": [ "actions/checkout", @@ -16,7 +17,8 @@ "actions/stale", "actions/starter-workflows", "actions/upload-artifact", - "actions/upload-release-asset" + "actions/upload-release-asset", + "github/codeql-action" ], "partners": [ "Alibaba Cloud",