Merge pull request #520 from actions/cschleiden/reduce-ghes-workflows
Do not sync workflows without categories to GHES
This commit is contained in:
@@ -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,16 +43,21 @@ 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 isBlankTemplate = workflowId === "blank";
|
||||
const partnerWorkflow = workflowProperties.categories === null;
|
||||
|
||||
const enabled =
|
||||
(isBlankTemplate || !partnerWorkflow) &&
|
||||
(await checkWorkflow(workflowFilePath, enabledActions));
|
||||
|
||||
const workflowDesc: WorkflowDesc = {
|
||||
folder,
|
||||
id: workflowId,
|
||||
|
||||
Reference in New Issue
Block a user