From 08790b8d41ab0e229cdebafc4682274365431da0 Mon Sep 17 00:00:00 2001 From: Mara Nikola Kiefer Date: Mon, 13 Apr 2026 15:32:40 +0200 Subject: [PATCH] Allow syncing .md starter workflows to GHES --- script/sync-ghes/index.ts | 12 ++++++++---- script/sync-ghes/settings.json | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index b8b705e..8c10f41 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -8,6 +8,7 @@ import { normalizeSvgIconName } from "../shared/icon-utils"; interface WorkflowDesc { folder: string; id: string; + fileExtension: string; iconName?: string; iconType?: "svg" | "octicon"; } @@ -48,9 +49,10 @@ async function checkWorkflows( }); for (const e of dir) { - if (e.isFile() && extname(e.name) === ".yml") { + if (e.isFile() && (".yml" === extname(e.name) || ".md" === extname(e.name))) { + const fileExtension = extname(e.name); const workflowFilePath = join(folder, e.name); - const workflowId = basename(e.name, extname(e.name)); + const workflowId = basename(e.name, fileExtension); const workflowProperties: WorkflowProperties = require(join( folder, "properties", @@ -67,11 +69,12 @@ async function checkWorkflows( const enabled = !isPartnerWorkflow && (workflowProperties.enterprise === true || basename(folder) !== 'code-scanning') && - (await checkWorkflow(workflowFilePath, enabledActions)); + (fileExtension === ".md" || await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = { folder, id: workflowId, + fileExtension, iconName: normalizedSvgIconName, iconType: normalizedSvgIconName && normalizedSvgIconName.startsWith("octicon") ? "octicon" : "svg", @@ -189,7 +192,7 @@ async function checkWorkflow( // Don't touch read-only folders if (!settings.readOnlyFolders.includes(x.folder)) { - r.push(join(x.folder, `${x.id}.yml`)); + r.push(join(x.folder, `${x.id}${x.fileExtension}`)); r.push(join(x.folder, "properties", `${x.id}.properties.json`)); }; @@ -210,6 +213,7 @@ async function checkWorkflow( // The v4 versions of upload and download artifact are not yet supported on GHES console.group("Updating all compatible workflows to use v3 of the artifact actions"); for (const workflow of result.compatibleWorkflows) { + if (workflow.fileExtension !== ".yml") continue; const path = join(workflow.folder, `${workflow.id}.yml`); console.log(`Updating ${path}`); const contents = await fs.readFile(path, "utf8"); diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index ce18eb6..1e70938 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -3,7 +3,8 @@ "../../ci", "../../automation", "../../code-scanning", - "../../pages" + "../../pages", + "../../agentic" ], "readOnlyFolders": [ "../../pages"