diff --git a/ci/properties/alibabacloud.properties.json b/ci/properties/alibabacloud.properties.json index bbee6df..1ce285f 100644 --- a/ci/properties/alibabacloud.properties.json +++ b/ci/properties/alibabacloud.properties.json @@ -3,5 +3,5 @@ "description": "Deploy a container to Alibaba Cloud Container Service for Kubernetes (ACK).", "creator": "Alibaba Cloud", "iconName": "alibabacloud", - "categories": null + "categories": ["Deployment"] } diff --git a/ci/properties/aws.properties.json b/ci/properties/aws.properties.json index b80775f..10a7ed3 100644 --- a/ci/properties/aws.properties.json +++ b/ci/properties/aws.properties.json @@ -3,5 +3,5 @@ "description": "Deploy a container to an Amazon ECS service powered by AWS Fargate or Amazon EC2.", "creator": "Amazon Web Services", "iconName": "aws", - "categories": null + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/azure.properties.json b/ci/properties/azure.properties.json index fd9d0d8..362d5d1 100644 --- a/ci/properties/azure.properties.json +++ b/ci/properties/azure.properties.json @@ -3,5 +3,5 @@ "description": "Build a Node.js project and deploy it to an Azure Web App.", "creator": "Microsoft Azure", "iconName": "azure", - "categories": null + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/google.properties.json b/ci/properties/google.properties.json index e2d917d..c7f216f 100644 --- a/ci/properties/google.properties.json +++ b/ci/properties/google.properties.json @@ -3,5 +3,5 @@ "description": "Build a docker container, publish it to Google Container Registry, and deploy to GKE.", "creator": "Google Cloud", "iconName": "googlegke", - "categories": null + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/ibm.properties.json b/ci/properties/ibm.properties.json index cfd0383..4219690 100644 --- a/ci/properties/ibm.properties.json +++ b/ci/properties/ibm.properties.json @@ -3,5 +3,5 @@ "description": "Build a docker container, publish it to IBM Cloud Container Registry, and deploy to IBM Cloud Kubernetes Service.", "creator": "IBM", "iconName": "ibm", - "categories": null + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/openshift.properties.json b/ci/properties/openshift.properties.json index 53538c7..54948c2 100644 --- a/ci/properties/openshift.properties.json +++ b/ci/properties/openshift.properties.json @@ -3,5 +3,5 @@ "description": "Build a Docker-based project and deploy it to OpenShift.", "creator": "Red Hat", "iconName": "openshift", - "categories": [ "Dockerfile" ] + "categories": ["Dockerfile","Deployment" ] } diff --git a/ci/properties/tencent.properties.json b/ci/properties/tencent.properties.json index ba579a1..32d0da7 100644 --- a/ci/properties/tencent.properties.json +++ b/ci/properties/tencent.properties.json @@ -3,5 +3,5 @@ "description": "This workflow will build a docker container, publish and deploy it to Tencent Kubernetes Engine (TKE).", "creator": "Tencent Cloud", "iconName": "tencentcloud", - "categories": null + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/terraform.properties.json b/ci/properties/terraform.properties.json index bfeabdf..12afabe 100644 --- a/ci/properties/terraform.properties.json +++ b/ci/properties/terraform.properties.json @@ -3,5 +3,5 @@ "description": "Set up Terraform CLI in your GitHub Actions workflow.", "creator": "HashiCorp", "iconName": "terraform", - "categories": null + "categories": ["Deployment"] } diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index 0fa3440..e37eca3 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -19,6 +19,8 @@ interface WorkflowProperties { iconName?: string; categories: string[] | null; + + creator?: string; } interface WorkflowsCheckResult { @@ -28,12 +30,14 @@ interface WorkflowsCheckResult { async function checkWorkflows( folders: string[], - enabledActions: string[] + enabledActions: string[], + partners: string[] ): Promise { const result: WorkflowsCheckResult = { compatibleWorkflows: [], incompatibleWorkflows: [], }; + const partnersSet = new Set(partners.map((x) => x.toLowerCase())); for (const folder of folders) { const dir = await fs.readdir(folder, { @@ -51,11 +55,10 @@ async function checkWorkflows( )); const iconName: string | undefined = workflowProperties["iconName"]; - const isBlankTemplate = workflowId === "blank"; - const partnerWorkflow = workflowProperties.categories === null; + const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; const enabled = - (isBlankTemplate || !partnerWorkflow) && + !isPartnerWorkflow && (await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = { @@ -90,7 +93,6 @@ async function checkWorkflow( ): Promise { // Create set with lowercase action names for easier, case-insensitive lookup const enabledActionsSet = new Set(enabledActions.map((x) => x.toLowerCase())); - try { const workflowFileContent = await fs.readFile(workflowPath, "utf8"); const workflow = safeLoad(workflowFileContent); @@ -126,7 +128,8 @@ async function checkWorkflow( const result = await checkWorkflows( settings.folders, - settings.enabledActions + settings.enabledActions, + settings.partners ); console.group( diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index 050ea0a..60b70ed 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -16,5 +16,15 @@ "actions/starter-workflows", "actions/upload-artifact", "actions/upload-release-asset" + ], + "partners": [ + "Alibaba Cloud", + "Amazon Web Services", + "Microsoft Azure", + "Google Cloud", + "IBM", + "Red Hat", + "Tencent Cloud", + "HashiCorp" ] }