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";
|
iconType?: "svg" | "octicon";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface WorkflowProperties {
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
description: string;
|
||||||
|
|
||||||
|
iconName?: string;
|
||||||
|
|
||||||
|
categories: string[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
interface WorkflowsCheckResult {
|
interface WorkflowsCheckResult {
|
||||||
compatibleWorkflows: WorkflowDesc[];
|
compatibleWorkflows: WorkflowDesc[];
|
||||||
incompatibleWorkflows: WorkflowDesc[];
|
incompatibleWorkflows: WorkflowDesc[];
|
||||||
@@ -33,16 +43,21 @@ async function checkWorkflows(
|
|||||||
for (const e of dir) {
|
for (const e of dir) {
|
||||||
if (e.isFile()) {
|
if (e.isFile()) {
|
||||||
const workflowFilePath = join(folder, e.name);
|
const workflowFilePath = join(folder, e.name);
|
||||||
const enabled = await checkWorkflow(workflowFilePath, enabledActions);
|
|
||||||
|
|
||||||
const workflowId = basename(e.name, extname(e.name));
|
const workflowId = basename(e.name, extname(e.name));
|
||||||
const workflowProperties = require(join(
|
const workflowProperties: WorkflowProperties = require(join(
|
||||||
folder,
|
folder,
|
||||||
"properties",
|
"properties",
|
||||||
`${workflowId}.properties.json`
|
`${workflowId}.properties.json`
|
||||||
));
|
));
|
||||||
const iconName: string | undefined = workflowProperties["iconName"];
|
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 = {
|
const workflowDesc: WorkflowDesc = {
|
||||||
folder,
|
folder,
|
||||||
id: workflowId,
|
id: workflowId,
|
||||||
|
|||||||
Reference in New Issue
Block a user