Merge pull request #1058 from aparna-ravindra/deployment_as_a_category

"deployment" as a category in properties.json
This commit is contained in:
Ashwin Sangem
2021-08-25 09:49:12 +05:30
committed by GitHub
10 changed files with 27 additions and 14 deletions
+1 -1
View File
@@ -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"]
}
+1 -1
View File
@@ -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"]
}
+1 -1
View File
@@ -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"]
}
+1 -1
View File
@@ -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"]
}
+1 -1
View File
@@ -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"]
}
+1 -1
View File
@@ -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" ]
}
+1 -1
View File
@@ -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"]
}
+1 -1
View File
@@ -3,5 +3,5 @@
"description": "Set up Terraform CLI in your GitHub Actions workflow.",
"creator": "HashiCorp",
"iconName": "terraform",
"categories": null
"categories": ["Deployment"]
}
+9 -6
View File
@@ -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<WorkflowsCheckResult> {
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<boolean> {
// 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(
+10
View File
@@ -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"
]
}