From 15c78f880211e02929edf5ff0d59c225e9f11c69 Mon Sep 17 00:00:00 2001 From: Christopher Schleiden Date: Thu, 21 May 2020 11:09:51 -0700 Subject: [PATCH 1/2] Do not sync workflows without categories to GHES --- script/sync-ghes/index.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index 5390664..78a0dda 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -11,6 +11,16 @@ interface WorkflowDesc { iconType?: "svg" | "octicon"; } +interface WorkflowProperties { + name: string; + + description: string; + + iconName?: string; + + categories: string[] | null; +} + interface WorkflowsCheckResult { compatibleWorkflows: WorkflowDesc[]; incompatibleWorkflows: WorkflowDesc[]; @@ -33,15 +43,18 @@ async function checkWorkflows( for (const e of dir) { if (e.isFile()) { const workflowFilePath = join(folder, e.name); - const enabled = await checkWorkflow(workflowFilePath, enabledActions); - const workflowId = basename(e.name, extname(e.name)); - const workflowProperties = require(join( + const workflowProperties: WorkflowProperties = require(join( folder, "properties", `${workflowId}.properties.json` )); const iconName: string | undefined = workflowProperties["iconName"]; + const partnerWorkflow = workflowProperties.categories === null; + + const enabled = + !partnerWorkflow && + (await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = { folder, From de4411e09783092951dd168aa2651c251f4eb765 Mon Sep 17 00:00:00 2001 From: Christopher Schleiden Date: Thu, 21 May 2020 14:34:40 -0700 Subject: [PATCH 2/2] Ensure "blank" template is available --- script/sync-ghes/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index 78a0dda..ea347cf 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -50,10 +50,12 @@ async function checkWorkflows( `${workflowId}.properties.json` )); const iconName: string | undefined = workflowProperties["iconName"]; + + const isBlankTemplate = workflowId === "blank"; const partnerWorkflow = workflowProperties.categories === null; const enabled = - !partnerWorkflow && + (isBlankTemplate || !partnerWorkflow) && (await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = {