Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e526628119 |
@@ -33,13 +33,15 @@ interface WorkflowsCheckResult {
|
||||
async function checkWorkflows(
|
||||
folders: string[],
|
||||
enabledActions: string[],
|
||||
partners: string[]
|
||||
partners: string[],
|
||||
codeScanningTemplates: string[]
|
||||
): Promise<WorkflowsCheckResult> {
|
||||
const result: WorkflowsCheckResult = {
|
||||
compatibleWorkflows: [],
|
||||
incompatibleWorkflows: [],
|
||||
};
|
||||
const partnersSet = new Set(partners.map((x) => x.toLowerCase()));
|
||||
const codeScanningTemplatesSet = new Set(codeScanningTemplates)
|
||||
|
||||
for (const folder of folders) {
|
||||
const dir = await fs.readdir(folder, {
|
||||
@@ -59,9 +61,11 @@ async function checkWorkflows(
|
||||
|
||||
const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false;
|
||||
|
||||
const isCodeScanningTemplateEnabled = (folder === "../../code-scanning") ? codeScanningTemplatesSet.has(e.name) : true;
|
||||
|
||||
const enabled =
|
||||
!isPartnerWorkflow &&
|
||||
workflowProperties.enterprise !== false &&
|
||||
isCodeScanningTemplateEnabled &&
|
||||
(await checkWorkflow(workflowFilePath, enabledActions));
|
||||
|
||||
const workflowDesc: WorkflowDesc = {
|
||||
@@ -133,7 +137,8 @@ async function checkWorkflow(
|
||||
const result = await checkWorkflows(
|
||||
settings.folders,
|
||||
settings.enabledActions,
|
||||
settings.partners
|
||||
settings.partners,
|
||||
settings.codeScanningTemplates
|
||||
);
|
||||
|
||||
console.group(
|
||||
|
||||
@@ -28,5 +28,8 @@
|
||||
"Red Hat",
|
||||
"Tencent Cloud",
|
||||
"HashiCorp"
|
||||
],
|
||||
"codeScanningTemplates": [
|
||||
"codeql.yml"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user