From 8bec7d688737fc8c71bd141d429b55f2ced9065c Mon Sep 17 00:00:00 2001 From: rui Date: Wed, 18 Aug 2021 19:28:16 -0400 Subject: [PATCH 01/38] go: use go1.17 (#1045) Signed-off-by: Rui Chen Co-authored-by: Josh Gross --- ci/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/go.yml b/ci/go.yml index 22a110a..afff652 100644 --- a/ci/go.yml +++ b/ci/go.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Build run: go build -v ./... From 07d3c6475745417e7b9c26f6689876ccf11675ab Mon Sep 17 00:00:00 2001 From: Robin Neatherway Date: Thu, 19 Aug 2021 12:42:33 +0100 Subject: [PATCH 02/38] Minor grammar fix --- code-scanning/properties/devskim.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-scanning/properties/devskim.properties.json b/code-scanning/properties/devskim.properties.json index 0eab5c6..40fd52b 100644 --- a/code-scanning/properties/devskim.properties.json +++ b/code-scanning/properties/devskim.properties.json @@ -1,7 +1,7 @@ { "name": "DevSkim", "creator": "Microsoft CST-E", - "description": "DevSkim is security linter that highlights common security issues in source code.", + "description": "DevSkim is a security linter that highlights common security issues in source code.", "iconName": "cst-logo", "categories": ["Code Scanning", "C", "C#", "C++", "Go", "Java", "JavaScript", "TypeScript", "Python", "Powershell", "Cobol", "Objective C", "PHP", "Ruby", "Rust", "SQL", "Swift", "Visual Basic"] } From 671fc9a635ceb98715aa869d6172317da7bb3b33 Mon Sep 17 00:00:00 2001 From: aparna-ravindra Date: Mon, 23 Aug 2021 11:00:59 +0530 Subject: [PATCH 03/38] deployment as a category in properties.json --- ci/properties/alibabacloud.properties.json | 2 +- ci/properties/aws.properties.json | 2 +- ci/properties/azure.properties.json | 2 +- ci/properties/google.properties.json | 2 +- ci/properties/ibm.properties.json | 2 +- ci/properties/openshift.properties.json | 2 +- ci/properties/tencent.properties.json | 2 +- ci/properties/terraform.properties.json | 2 +- script/sync-ghes/index.ts | 15 +++++++++------ script/sync-ghes/settings.json | 10 ++++++++++ 10 files changed, 27 insertions(+), 14 deletions(-) diff --git a/ci/properties/alibabacloud.properties.json b/ci/properties/alibabacloud.properties.json index bbee6df..f1e33f2 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..33c3064 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..4970936 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..ed69c5e 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..0c1efdc 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..d500aa9 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": [ "deployment", "Dockerfile" ] } diff --git a/ci/properties/tencent.properties.json b/ci/properties/tencent.properties.json index ba579a1..465073e 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..9929d33 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..ea67432 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 partnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; const enabled = - (isBlankTemplate || !partnerWorkflow) && + !partnerWorkflow && (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" ] } From b2ac199660644065c2468dbf53cf85811f6d07de Mon Sep 17 00:00:00 2001 From: aparna-ravindra Date: Mon, 23 Aug 2021 11:08:57 +0530 Subject: [PATCH 04/38] reordering categories --- ci/properties/openshift.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/openshift.properties.json b/ci/properties/openshift.properties.json index d500aa9..1bc2eca 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": [ "deployment", "Dockerfile" ] + "categories": ["Dockerfile","deployment" ] } From f5724905e59be4fea1e9005c20734660e07c36fe Mon Sep 17 00:00:00 2001 From: aparna-ravindra Date: Mon, 23 Aug 2021 12:47:22 +0530 Subject: [PATCH 05/38] capitalizing category --- ci/properties/alibabacloud.properties.json | 2 +- ci/properties/aws.properties.json | 2 +- ci/properties/azure.properties.json | 2 +- ci/properties/google.properties.json | 2 +- ci/properties/ibm.properties.json | 2 +- ci/properties/openshift.properties.json | 2 +- ci/properties/tencent.properties.json | 2 +- ci/properties/terraform.properties.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/properties/alibabacloud.properties.json b/ci/properties/alibabacloud.properties.json index f1e33f2..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": ["deployment"] + "categories": ["Deployment"] } diff --git a/ci/properties/aws.properties.json b/ci/properties/aws.properties.json index 33c3064..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": ["deployment"] + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/azure.properties.json b/ci/properties/azure.properties.json index 4970936..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": ["deployment"] + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/google.properties.json b/ci/properties/google.properties.json index ed69c5e..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": ["deployment"] + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/ibm.properties.json b/ci/properties/ibm.properties.json index 0c1efdc..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": ["deployment"] + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/openshift.properties.json b/ci/properties/openshift.properties.json index 1bc2eca..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","deployment" ] + "categories": ["Dockerfile","Deployment" ] } diff --git a/ci/properties/tencent.properties.json b/ci/properties/tencent.properties.json index 465073e..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": ["deployment"] + "categories": ["Deployment"] } \ No newline at end of file diff --git a/ci/properties/terraform.properties.json b/ci/properties/terraform.properties.json index 9929d33..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": ["deployment"] + "categories": ["Deployment"] } From e56cb5c21591a7ad820f6c22de2e7d212ead898b Mon Sep 17 00:00:00 2001 From: aparna-ravindra Date: Tue, 24 Aug 2021 10:28:09 +0530 Subject: [PATCH 06/38] renaming variable --- script/sync-ghes/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index ea67432..e37eca3 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -55,10 +55,10 @@ async function checkWorkflows( )); const iconName: string | undefined = workflowProperties["iconName"]; - const partnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; + const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; const enabled = - !partnerWorkflow && + !isPartnerWorkflow && (await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = { From 7f3356b05c1b9819637ee9f05e560c498d923489 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 24 Aug 2021 17:31:06 +0300 Subject: [PATCH 07/38] update android, gradle and maven workflows to use caching from setup-java --- ci/android.yml | 1 + ci/gradle.yml | 3 ++- ci/maven.yml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/android.yml b/ci/android.yml index 4bbc689..3037b9f 100644 --- a/ci/android.yml +++ b/ci/android.yml @@ -18,6 +18,7 @@ jobs: with: java-version: '11' distribution: 'adopt' + cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/ci/gradle.yml b/ci/gradle.yml index 6e7e922..282983b 100644 --- a/ci/gradle.yml +++ b/ci/gradle.yml @@ -1,4 +1,4 @@ -# This workflow will build a Java project with Gradle +# This workflow will build a Java project with Gradle, cache/restore dependecies # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle name: Java CI with Gradle @@ -21,6 +21,7 @@ jobs: with: java-version: '11' distribution: 'adopt' + cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/ci/maven.yml b/ci/maven.yml index 923425b..90ffc0a 100644 --- a/ci/maven.yml +++ b/ci/maven.yml @@ -1,4 +1,4 @@ -# This workflow will build a Java project with Maven +# This workflow will build a Java project with Maven, cache/restore dependecies # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: Java CI with Maven @@ -21,5 +21,6 @@ jobs: with: java-version: '11' distribution: 'adopt' + cache: maven - name: Build with Maven run: mvn -B package --file pom.xml From 138cc494633c38a75c8fb68b7b5ed40ebd7b27b0 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 24 Aug 2021 18:25:52 +0300 Subject: [PATCH 08/38] fix documentation for gradle and maven --- ci/gradle.yml | 2 +- ci/maven.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/gradle.yml b/ci/gradle.yml index 282983b..5ecabba 100644 --- a/ci/gradle.yml +++ b/ci/gradle.yml @@ -1,4 +1,4 @@ -# This workflow will build a Java project with Gradle, cache/restore dependecies +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle name: Java CI with Gradle diff --git a/ci/maven.yml b/ci/maven.yml index 90ffc0a..ac3b6de 100644 --- a/ci/maven.yml +++ b/ci/maven.yml @@ -1,4 +1,4 @@ -# This workflow will build a Java project with Maven, cache/restore dependecies +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: Java CI with Maven From 680b06affc863e6706b2b56707385cfc4c9534a4 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari <64764738+tiwarishub@users.noreply.github.com> Date: Wed, 25 Aug 2021 00:13:11 +0530 Subject: [PATCH 09/38] Update node.js.properties.json --- ci/properties/node.js.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/node.js.properties.json b/ci/properties/node.js.properties.json index 6ab4c53..d584575 100644 --- a/ci/properties/node.js.properties.json +++ b/ci/properties/node.js.properties.json @@ -2,5 +2,5 @@ "name": "Node.js", "description": "Build and test a Node.js project with npm.", "iconName": "nodejs", - "categories": ["JavaScript", "Node", "Npm"] + "categories": ["JavaScript", "Node", "npm"] } From e4eea0ea9c76248066af2849e9890460016f4454 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari <64764738+tiwarishub@users.noreply.github.com> Date: Wed, 25 Aug 2021 00:17:17 +0530 Subject: [PATCH 10/38] Update npm-publish.properties.json --- ci/properties/npm-publish.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/npm-publish.properties.json b/ci/properties/npm-publish.properties.json index d253373..764dbf3 100644 --- a/ci/properties/npm-publish.properties.json +++ b/ci/properties/npm-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Node.js Package", "description": "Publishes a Node.js package to npm and GitHub Packages.", "iconName": "node-package-transparent", - "categories": ["JavaScript", "SDLC"] + "categories": ["JavaScript", "npm"] } From 973d29b6bf4000cbcfb47cb1b15ecf1fb42b4099 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari <64764738+tiwarishub@users.noreply.github.com> Date: Wed, 25 Aug 2021 00:17:39 +0530 Subject: [PATCH 11/38] Update gem-push.properties.json --- ci/properties/gem-push.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/gem-push.properties.json b/ci/properties/gem-push.properties.json index c54e7b5..188d80a 100644 --- a/ci/properties/gem-push.properties.json +++ b/ci/properties/gem-push.properties.json @@ -2,5 +2,5 @@ "name": "Ruby Gem", "description": "Pushes a Ruby Gem to RubyGems and GitHub Package Registry.", "iconName": "ruby-gems", - "categories": ["Ruby", "SDLC"] + "categories": ["Ruby"] } From bb64945011c8c6fc09e043d4e1ac5c87567efb16 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari <64764738+tiwarishub@users.noreply.github.com> Date: Wed, 25 Aug 2021 00:31:52 +0530 Subject: [PATCH 12/38] Update node.js.properties.json --- ci/properties/node.js.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/node.js.properties.json b/ci/properties/node.js.properties.json index d584575..557222a 100644 --- a/ci/properties/node.js.properties.json +++ b/ci/properties/node.js.properties.json @@ -2,5 +2,5 @@ "name": "Node.js", "description": "Build and test a Node.js project with npm.", "iconName": "nodejs", - "categories": ["JavaScript", "Node", "npm"] + "categories": ["JavaScript", "npm"] } From 108dfef5d2f4348e0ce0a0b644a09f65ac2c5941 Mon Sep 17 00:00:00 2001 From: Cadu Ribeiro Date: Mon, 30 Aug 2021 16:42:14 -0300 Subject: [PATCH 13/38] Add a descriptive comment into stale.yml This PR adds a descriptive comment int "stale.yml" so user know what this does and how adjust. This can be helpful because user's can come to this workflow as a template directly from their issue page and this extra content will help them understand what is this. --- automation/stale.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/automation/stale.yml b/automation/stale.yml index 277380b..ff88dc0 100644 --- a/automation/stale.yml +++ b/automation/stale.yml @@ -1,3 +1,8 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale name: Mark stale issues and pull requests on: From ac64f9caf525d2edb32be9675873db463c01d1d8 Mon Sep 17 00:00:00 2001 From: Varun Sharma Date: Thu, 2 Sep 2021 13:05:24 -0700 Subject: [PATCH 14/38] Secure workflows (#1) (#1072) * Restrict permissions for the GITHUB_TOKEN in .github/workflows/label-feature.yml * Restrict permissions for the GITHUB_TOKEN in .github/workflows/label-support.yml * Restrict permissions for the GITHUB_TOKEN in .github/workflows/stale.yml * Restrict permissions for the GITHUB_TOKEN in .github/workflows/sync_ghes.yaml * Restrict permissions for the GITHUB_TOKEN in .github/workflows/validate-data.yaml Co-authored-by: Step Security Co-authored-by: step-security[bot] <89328102+step-security[bot]@users.noreply.github.com> Co-authored-by: Step Security --- .github/workflows/label-feature.yml | 2 ++ .github/workflows/label-support.yml | 2 ++ .github/workflows/stale.yml | 3 +++ .github/workflows/sync_ghes.yaml | 2 ++ .github/workflows/validate-data.yaml | 2 ++ 5 files changed, 11 insertions(+) diff --git a/.github/workflows/label-feature.yml b/.github/workflows/label-feature.yml index 96ac8c1..d13cf87 100644 --- a/.github/workflows/label-feature.yml +++ b/.github/workflows/label-feature.yml @@ -5,6 +5,8 @@ on: jobs: build: + permissions: + issues: write runs-on: ubuntu-latest steps: - name: Close Issue diff --git a/.github/workflows/label-support.yml b/.github/workflows/label-support.yml index c6f2aa4..ea0f240 100644 --- a/.github/workflows/label-support.yml +++ b/.github/workflows/label-support.yml @@ -5,6 +5,8 @@ on: jobs: build: + permissions: + issues: write runs-on: ubuntu-latest steps: - name: Close Issue diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index c116b93..217078a 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,6 +7,9 @@ on: jobs: stale: + permissions: + issues: write + pull-requests: write runs-on: ubuntu-latest steps: diff --git a/.github/workflows/sync_ghes.yaml b/.github/workflows/sync_ghes.yaml index a3c298a..946218f 100644 --- a/.github/workflows/sync_ghes.yaml +++ b/.github/workflows/sync_ghes.yaml @@ -7,6 +7,8 @@ on: jobs: sync: + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/validate-data.yaml b/.github/workflows/validate-data.yaml index 745bc25..7d5c1ee 100644 --- a/.github/workflows/validate-data.yaml +++ b/.github/workflows/validate-data.yaml @@ -6,6 +6,8 @@ on: jobs: validate-data: + permissions: + contents: read runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 7b64f441651d3005d0849daa72311c22052441d6 Mon Sep 17 00:00:00 2001 From: Aparna Ravindra <82894348+aparna-ravindra@users.noreply.github.com> Date: Mon, 6 Sep 2021 11:04:54 +0530 Subject: [PATCH 15/38] Directory for deployments (#1071) * moving deployment templates * including deployment directory in scripts * validate categories script init * introducing scout * introducing workflow * Update validate-categories.yaml * Update validate-categories.yaml * Update validate-categories.yaml * Update validate.rb * Update validate.rb * Update validate.rb * Update validate.rb * Update validate-categories.yaml * Update validate-categories.yaml * Update validate-categories.yaml * Update validate.rb * Update validate-categories.yaml * Update validate-categories.yaml * Create test_comment.yaml * rename * using [enter] * testing newline * test * setting up variable * using echo -e * using join * testing space space new line * setting multi line in echo * removing checkout * setting rows-generator * fixing error * using join * commit * Update test_comment.yaml * escaping pipe * printing debug line * using %0A * Update validate-categories.yaml * Update validate.rb * Update validate.rb * removing debug * removing variable * Update validate.rb * Update validate-categories.yaml * Validate categories comment on pr (#32) * reverting deployment directory * checking for output * Categories validation two workflows (#34) comment on pr in a separate workflow * Categories validation two workflows (#35) using right dir name * Categories validation two workflows (#36) . * Categories validation two workflows (#37) fixing typo * adding if conditions * adding try catch * using console instead of echo * equating to upstream * moving deployment templates --- {ci => deployments}/alibabacloud.yml | 0 {ci => deployments}/aws.yml | 0 {ci => deployments}/azure.yml | 0 {ci => deployments}/google.yml | 0 {ci => deployments}/ibm.yml | 0 {ci => deployments}/openshift.yml | 0 {ci => deployments}/properties/alibabacloud.properties.json | 0 {ci => deployments}/properties/aws.properties.json | 0 {ci => deployments}/properties/azure.properties.json | 0 {ci => deployments}/properties/google.properties.json | 0 {ci => deployments}/properties/ibm.properties.json | 0 {ci => deployments}/properties/openshift.properties.json | 0 {ci => deployments}/properties/tencent.properties.json | 0 {ci => deployments}/properties/terraform.properties.json | 0 {ci => deployments}/tencent.yml | 0 {ci => deployments}/terraform.yml | 0 script/sync-ghes/settings.json | 3 ++- script/validate-data/settings.json | 3 ++- 18 files changed, 4 insertions(+), 2 deletions(-) rename {ci => deployments}/alibabacloud.yml (100%) rename {ci => deployments}/aws.yml (100%) rename {ci => deployments}/azure.yml (100%) rename {ci => deployments}/google.yml (100%) rename {ci => deployments}/ibm.yml (100%) rename {ci => deployments}/openshift.yml (100%) rename {ci => deployments}/properties/alibabacloud.properties.json (100%) rename {ci => deployments}/properties/aws.properties.json (100%) rename {ci => deployments}/properties/azure.properties.json (100%) rename {ci => deployments}/properties/google.properties.json (100%) rename {ci => deployments}/properties/ibm.properties.json (100%) rename {ci => deployments}/properties/openshift.properties.json (100%) rename {ci => deployments}/properties/tencent.properties.json (100%) rename {ci => deployments}/properties/terraform.properties.json (100%) rename {ci => deployments}/tencent.yml (100%) rename {ci => deployments}/terraform.yml (100%) diff --git a/ci/alibabacloud.yml b/deployments/alibabacloud.yml similarity index 100% rename from ci/alibabacloud.yml rename to deployments/alibabacloud.yml diff --git a/ci/aws.yml b/deployments/aws.yml similarity index 100% rename from ci/aws.yml rename to deployments/aws.yml diff --git a/ci/azure.yml b/deployments/azure.yml similarity index 100% rename from ci/azure.yml rename to deployments/azure.yml diff --git a/ci/google.yml b/deployments/google.yml similarity index 100% rename from ci/google.yml rename to deployments/google.yml diff --git a/ci/ibm.yml b/deployments/ibm.yml similarity index 100% rename from ci/ibm.yml rename to deployments/ibm.yml diff --git a/ci/openshift.yml b/deployments/openshift.yml similarity index 100% rename from ci/openshift.yml rename to deployments/openshift.yml diff --git a/ci/properties/alibabacloud.properties.json b/deployments/properties/alibabacloud.properties.json similarity index 100% rename from ci/properties/alibabacloud.properties.json rename to deployments/properties/alibabacloud.properties.json diff --git a/ci/properties/aws.properties.json b/deployments/properties/aws.properties.json similarity index 100% rename from ci/properties/aws.properties.json rename to deployments/properties/aws.properties.json diff --git a/ci/properties/azure.properties.json b/deployments/properties/azure.properties.json similarity index 100% rename from ci/properties/azure.properties.json rename to deployments/properties/azure.properties.json diff --git a/ci/properties/google.properties.json b/deployments/properties/google.properties.json similarity index 100% rename from ci/properties/google.properties.json rename to deployments/properties/google.properties.json diff --git a/ci/properties/ibm.properties.json b/deployments/properties/ibm.properties.json similarity index 100% rename from ci/properties/ibm.properties.json rename to deployments/properties/ibm.properties.json diff --git a/ci/properties/openshift.properties.json b/deployments/properties/openshift.properties.json similarity index 100% rename from ci/properties/openshift.properties.json rename to deployments/properties/openshift.properties.json diff --git a/ci/properties/tencent.properties.json b/deployments/properties/tencent.properties.json similarity index 100% rename from ci/properties/tencent.properties.json rename to deployments/properties/tencent.properties.json diff --git a/ci/properties/terraform.properties.json b/deployments/properties/terraform.properties.json similarity index 100% rename from ci/properties/terraform.properties.json rename to deployments/properties/terraform.properties.json diff --git a/ci/tencent.yml b/deployments/tencent.yml similarity index 100% rename from ci/tencent.yml rename to deployments/tencent.yml diff --git a/ci/terraform.yml b/deployments/terraform.yml similarity index 100% rename from ci/terraform.yml rename to deployments/terraform.yml diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index 60b70ed..eef1700 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -1,7 +1,8 @@ { "folders": [ "../../ci", - "../../automation" + "../../automation", + "../../deployments" ], "enabledActions": [ "actions/checkout", diff --git a/script/validate-data/settings.json b/script/validate-data/settings.json index 1913e2f..f7c08cf 100644 --- a/script/validate-data/settings.json +++ b/script/validate-data/settings.json @@ -1,6 +1,7 @@ { "folders": [ "../../ci", - "../../automation" + "../../automation", + "../../deployments" ] } \ No newline at end of file From fc748cc482ce4ec8c9a2766913fc4cb128e0d443 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 6 Sep 2021 15:25:04 +0000 Subject: [PATCH 16/38] add codeql workflow to ghes --- script/sync-ghes/settings.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index eef1700..e4f50fa 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -2,7 +2,8 @@ "folders": [ "../../ci", "../../automation", - "../../deployments" + "../../deployments", + "../../code-scanning" ], "enabledActions": [ "actions/checkout", @@ -16,7 +17,8 @@ "actions/stale", "actions/starter-workflows", "actions/upload-artifact", - "actions/upload-release-asset" + "actions/upload-release-asset", + "github/codeql-action" ], "partners": [ "Alibaba Cloud", From 237e7737cee026d43e44c551a8676c64be6229f5 Mon Sep 17 00:00:00 2001 From: Aparna Ravindra <82894348+aparna-ravindra@users.noreply.github.com> Date: Wed, 8 Sep 2021 11:52:12 +0530 Subject: [PATCH 17/38] restoring from main (#1078) --- ci/properties/rails-lint.properties.json | 6 +++++ ci/rails-lint.yml | 32 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 ci/properties/rails-lint.properties.json create mode 100644 ci/rails-lint.yml diff --git a/ci/properties/rails-lint.properties.json b/ci/properties/rails-lint.properties.json new file mode 100644 index 0000000..7a109a1 --- /dev/null +++ b/ci/properties/rails-lint.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Rails - Build and Run Linters", + "description": "Build Rails application and run linters", + "iconName": "ruby", + "categories": ["Ruby", "Rails"] +} diff --git a/ci/rails-lint.yml b/ci/rails-lint.yml new file mode 100644 index 0000000..b2f8832 --- /dev/null +++ b/ci/rails-lint.yml @@ -0,0 +1,32 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will download a prebuilt Ruby version, install dependencies, and run linters +name: Build Rails and run linters + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] +jobs: + run-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Ruby and install gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + # Add or Replace any other security checks here + - name: Run security checks + run: | + bin/bundler-audit --update + bin/brakeman -q -w2 + # Add or Replace any other Linters here + - name: Run linters + run: | + bin/rubocop --parallel \ No newline at end of file From 41e3bc11ea093336b770562a40ecc3a635ab0f36 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Wed, 8 Sep 2021 07:26:24 +0100 Subject: [PATCH 18/38] Revert "add codeql workflow to ghes branch" --- script/sync-ghes/settings.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index e4f50fa..eef1700 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -2,8 +2,7 @@ "folders": [ "../../ci", "../../automation", - "../../deployments", - "../../code-scanning" + "../../deployments" ], "enabledActions": [ "actions/checkout", @@ -17,8 +16,7 @@ "actions/stale", "actions/starter-workflows", "actions/upload-artifact", - "actions/upload-release-asset", - "github/codeql-action" + "actions/upload-release-asset" ], "partners": [ "Alibaba Cloud", From e6aff964db94e534ef48eb04bdc7eea5e3383d0a Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Wed, 8 Sep 2021 09:54:15 +0100 Subject: [PATCH 19/38] add codeql workflow to ghes --- script/sync-ghes/settings.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/sync-ghes/settings.json b/script/sync-ghes/settings.json index eef1700..e4f50fa 100644 --- a/script/sync-ghes/settings.json +++ b/script/sync-ghes/settings.json @@ -2,7 +2,8 @@ "folders": [ "../../ci", "../../automation", - "../../deployments" + "../../deployments", + "../../code-scanning" ], "enabledActions": [ "actions/checkout", @@ -16,7 +17,8 @@ "actions/stale", "actions/starter-workflows", "actions/upload-artifact", - "actions/upload-release-asset" + "actions/upload-release-asset", + "github/codeql-action" ], "partners": [ "Alibaba Cloud", From 7aa19443113884c16be2b6c23964c0205bfbdb6e Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Wed, 8 Sep 2021 10:08:06 +0100 Subject: [PATCH 20/38] only run ghes sync checks on YML files --- script/sync-ghes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index e37eca3..95f70c0 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -45,7 +45,7 @@ async function checkWorkflows( }); for (const e of dir) { - if (e.isFile()) { + if (e.isFile() && extname(e.name) === ".yml") { const workflowFilePath = join(folder, e.name); const workflowId = basename(e.name, extname(e.name)); const workflowProperties: WorkflowProperties = require(join( From c2cc54a69e8f66b42dbbc3f29898787dba75c896 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Wed, 8 Sep 2021 10:28:14 +0100 Subject: [PATCH 21/38] only check nwo of supported actions --- script/sync-ghes/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/sync-ghes/index.ts b/script/sync-ghes/index.ts index 95f70c0..9edc70e 100755 --- a/script/sync-ghes/index.ts +++ b/script/sync-ghes/index.ts @@ -58,7 +58,7 @@ async function checkWorkflows( const isPartnerWorkflow = workflowProperties.creator ? partnersSet.has(workflowProperties.creator.toLowerCase()) : false; const enabled = - !isPartnerWorkflow && + !isPartnerWorkflow && (await checkWorkflow(workflowFilePath, enabledActions)); const workflowDesc: WorkflowDesc = { @@ -104,7 +104,8 @@ async function checkWorkflow( if (!!step.uses) { // Check if allowed action const [actionName, _] = step.uses.split("@"); - if (!enabledActionsSet.has(actionName.toLowerCase())) { + const actionNwo = actionName.split("/").slice(0, 2).join("/"); + if (!enabledActionsSet.has(actionNwo.toLowerCase())) { console.info( `Workflow ${workflowPath} uses '${actionName}' which is not supported for GHES.` ); From 84a9757692582ede3202521198d6167a59fb4b77 Mon Sep 17 00:00:00 2001 From: Ninad Kavimandan Date: Thu, 9 Sep 2021 16:16:31 +0530 Subject: [PATCH 22/38] added `React` and `Angular` as categories to node (#1084) --- ci/properties/node.js.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/node.js.properties.json b/ci/properties/node.js.properties.json index 557222a..c982d17 100644 --- a/ci/properties/node.js.properties.json +++ b/ci/properties/node.js.properties.json @@ -2,5 +2,5 @@ "name": "Node.js", "description": "Build and test a Node.js project with npm.", "iconName": "nodejs", - "categories": ["JavaScript", "npm"] + "categories": ["JavaScript", "npm", "React", "Angular"] } From b33f57dde1750be442deab22c2430b07d636cbba Mon Sep 17 00:00:00 2001 From: tmash06 Date: Fri, 10 Sep 2021 04:45:29 +0900 Subject: [PATCH 23/38] Fixed a broken link to actions/upload-a-build-artifact in dotnet-desktop.yml. (#1074) Co-authored-by: Josh Gross --- ci/dotnet-desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dotnet-desktop.yml b/ci/dotnet-desktop.yml index 2e55b15..0635779 100644 --- a/ci/dotnet-desktop.yml +++ b/ci/dotnet-desktop.yml @@ -107,7 +107,7 @@ jobs: - name: Remove the pfx run: Remove-Item -path $env:Wap_Project_Directory\$env:Signing_Certificate - # Upload the MSIX package: https://github.com/marketplace/actions/upload-artifact + # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact - name: Upload build artifacts uses: actions/upload-artifact@v2 with: From 028df69d88fa6b986e3ec1f52b4ae52300e87c5a Mon Sep 17 00:00:00 2001 From: Ashwin Sangem Date: Tue, 14 Sep 2021 08:04:52 +0530 Subject: [PATCH 24/38] Added support for Java Frameworks, Spring and JSF to CI Templates. (#1087) --- ci/properties/gradle-publish.properties.json | 2 +- ci/properties/gradle.properties.json | 2 +- ci/properties/maven-publish.properties.json | 2 +- ci/properties/maven.properties.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/properties/gradle-publish.properties.json b/ci/properties/gradle-publish.properties.json index 90b7295..3ec3f4f 100644 --- a/ci/properties/gradle-publish.properties.json +++ b/ci/properties/gradle-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Java Package with Gradle", "description": "Build a Java Package using Gradle and publish to GitHub Packages.", "iconName": "gradle", - "categories": ["Java", "Gradle"] + "categories": ["Java", "Gradle", "Spring", "JSF"] } \ No newline at end of file diff --git a/ci/properties/gradle.properties.json b/ci/properties/gradle.properties.json index bfe1a6f..c90f78f 100644 --- a/ci/properties/gradle.properties.json +++ b/ci/properties/gradle.properties.json @@ -2,5 +2,5 @@ "name": "Java with Gradle", "description": "Build and test a Java project using a Gradle wrapper script.", "iconName": "gradle", - "categories": ["Java", "Gradle"] + "categories": ["Java", "Gradle", "Spring", "JSF"] } diff --git a/ci/properties/maven-publish.properties.json b/ci/properties/maven-publish.properties.json index 2f59f41..41f2915 100644 --- a/ci/properties/maven-publish.properties.json +++ b/ci/properties/maven-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Java Package with Maven", "description": "Build a Java Package using Maven and publish to GitHub Packages.", "iconName": "maven", - "categories": ["Java", "Maven"] + "categories": ["Java", "Maven", "Spring", "JSF"] } \ No newline at end of file diff --git a/ci/properties/maven.properties.json b/ci/properties/maven.properties.json index e322d04..4086470 100644 --- a/ci/properties/maven.properties.json +++ b/ci/properties/maven.properties.json @@ -2,5 +2,5 @@ "name": "Java with Maven", "description": "Build and test a Java project with Apache Maven.", "iconName": "maven", - "categories": ["Java", "Maven"] + "categories": ["Java", "Maven", "Spring", "JSF"] } From 48e2865d35bc0e139da46143e78789a0ff753060 Mon Sep 17 00:00:00 2001 From: Tim Etchells Date: Tue, 14 Sep 2021 11:11:27 -0700 Subject: [PATCH 25/38] Update OpenShift workflow to use GHCR by default (#6) - Simplifies required configuration since a registry account is now optional - Update a variety of comments - Use tools-installer to install oc - Other small changes towards a better UX Signed-off-by: Tim Etchells --- deployments/openshift.yml | 147 ++++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 70 deletions(-) diff --git a/deployments/openshift.yml b/deployments/openshift.yml index ec5e0fb..fd090a8 100644 --- a/deployments/openshift.yml +++ b/deployments/openshift.yml @@ -3,61 +3,57 @@ # separate terms of service, privacy policy, and support # documentation. -### The OpenShift Starter workflow will: +# 💁 The OpenShift Starter workflow will: # - Checkout your repository -# - Perform a Docker build -# - Push the built image to an image registry +# - Perform a container image build +# - Push the built image to the GitHub Container Registry (GHCR) # - Log in to your OpenShift cluster -# - Create an OpenShift app from the image and expose it to the internet. +# - Create an OpenShift app from the image and expose it to the internet -### Before you begin: -# - Have write access to a container image registry such as quay.io or Dockerhub. -# - Have access to an OpenShift cluster. -# - For instructions to get started with OpenShift see https://www.openshift.com/try -# - The project you wish to add this workflow to should have a Dockerfile. -# - If you don't have a Dockerfile at the repository root, see the buildah-build step. -# - Builds from scratch are also available, but require more configuration. +# â„šī¸ Configure your repository and the workflow with the following steps: +# 1. Have access to an OpenShift cluster. Refer to https://www.openshift.com/try +# 2. Create the OPENSHIFT_SERVER and OPENSHIFT_TOKEN repository secrets. Refer to: +# - https://github.com/redhat-actions/oc-login#readme +# - https://docs.github.com/en/actions/reference/encrypted-secrets +# - https://cli.github.com/manual/gh_secret_set +# 3. (Optional) Edit the top-level 'env' section as marked with 'đŸ–Šī¸' if the defaults are not suitable for your project. +# 4. (Optional) Edit the build-image step to build your project. +# The default build type is by using a Dockerfile at the root of the repository, +# but can be replaced with a different file, a source-to-image build, or a step-by-step buildah build. +# 5. Commit and push the workflow file to your default branch to trigger a workflow run. -### To get the workflow running: -# 1. Add this workflow to your repository. -# 2. Edit the top-level 'env' section, which contains a list of environment variables that must be configured. -# 3. Create the secrets referenced in the 'env' section under your repository Settings. -# 4. Edit the 'branches' in the 'on' section to trigger the workflow on a push to your branch. -# 5. Commit and push your changes. - -# For a more sophisticated example, see https://github.com/redhat-actions/spring-petclinic/blob/main/.github/workflows/petclinic-sample.yaml -# Also see our GitHub organization, https://github.com/redhat-actions/ -# â–ļī¸ See a video of how to set up this workflow at https://www.youtube.com/watch?v=6hgBO-1pKho +# 👋 Visit our GitHub organization at https://github.com/redhat-actions/ to see our actions and provide feedback. name: OpenShift -# âŦ‡ī¸ Modify the fields marked with âŦ‡ī¸ to fit your project, and create any secrets that are referenced. -# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets env: - # âŦ‡ī¸ EDIT with your registry and registry path. - REGISTRY: quay.io/ - # âŦ‡ī¸ EDIT with your registry username. - REGISTRY_USER: - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - - # âŦ‡ī¸ EDIT to log into your OpenShift cluster and set up the context. + # đŸ–Šī¸ EDIT your repository secrets to log into your OpenShift cluster and set up the context. # See https://github.com/redhat-actions/oc-login#readme for how to retrieve these values. + # To get a permanent token, refer to https://github.com/redhat-actions/oc-login/wiki/Using-a-Service-Account-for-GitHub-Actions OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }} OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }} - - # âŦ‡ī¸ EDIT with any additional port your application should expose. - # By default, oc new-app action creates a service to the image's lowest numeric exposed port. - APP_PORT: "" - - # âŦ‡ī¸ EDIT if you wish to set the kube context's namespace after login. Leave blank to use the default namespace. + # đŸ–Šī¸ EDIT to set the kube context's namespace after login. Leave blank to use your user's default namespace. OPENSHIFT_NAMESPACE: "" - # If you wish to manually provide the APP_NAME and TAG, set them here, otherwise they will be auto-detected. + # đŸ–Šī¸ EDIT to set a name for your OpenShift app, or a default one will be generated below. APP_NAME: "" - TAG: "" + + # đŸ–Šī¸ EDIT with the port your application should be accessible on. + # If the container image exposes *exactly one* port, this can be left blank. + # Refer to the 'port' input of https://github.com/redhat-actions/oc-new-app + APP_PORT: "" + + # đŸ–Šī¸ EDIT to change the image registry settings. + # Registries such as GHCR, Quay.io, and Docker Hub are supported. + IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} + IMAGE_REGISTRY_USER: ${{ github.actor }} + IMAGE_REGISTRY_PASSWORD: ${{ github.token }} + + # đŸ–Šī¸ EDIT to specify custom tags for the container image, or default tags will be generated below. + IMAGE_TAGS: "" on: - # https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows + # https://docs.github.com/en/actions/reference/events-that-trigger-workflows push: # Edit to the branch(es) you want to build and deploy on each push. branches: [ $default-branch ] @@ -65,32 +61,40 @@ on: jobs: openshift-ci-cd: name: Build and deploy to OpenShift + # ubuntu-20.04 can also be used. runs-on: ubuntu-18.04 environment: production outputs: - ROUTE: ${{ steps.deploy-and-expose.outputs.route }} - SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }} + ROUTE: ${{ steps.deploy-and-expose.outputs.route }} + SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }} steps: - - name: Check if secrets exists + - name: Check for required secrets uses: actions/github-script@v3 with: script: | const secrets = { - REGISTRY_PASSWORD: `${{ secrets.REGISTRY_PASSWORD }}`, OPENSHIFT_SERVER: `${{ secrets.OPENSHIFT_SERVER }}`, OPENSHIFT_TOKEN: `${{ secrets.OPENSHIFT_TOKEN }}`, }; + const GHCR = "ghcr.io"; + if (`${{ env.IMAGE_REGISTRY }}`.startsWith(GHCR)) { + core.info(`Image registry is ${GHCR} - no registry password required`); + } + else { + core.info("A registry password is required"); + secrets["IMAGE_REGISTRY_PASSWORD"] = `${{ secrets.IMAGE_REGISTRY_PASSWORD }}`; + } + const missingSecrets = Object.entries(secrets).filter(([ name, value ]) => { if (value.length === 0) { - core.warning(`Secret "${name}" is not set`); + core.error(`Secret "${name}" is not set`); return true; } core.info(`âœ”ī¸ Secret "${name}" is set`); return false; - }); if (missingSecrets.length > 0) { @@ -104,48 +108,50 @@ jobs: core.info(`✅ All the required secrets are set`); } - - uses: actions/checkout@v2 + - name: Check out repository + uses: actions/checkout@v2 - name: Determine app name if: env.APP_NAME == '' run: | echo "APP_NAME=$(basename $PWD)" | tee -a $GITHUB_ENV - - name: Determine tag - if: env.TAG == '' + - name: Determine image tags + if: env.IMAGE_TAGS == '' run: | - echo "TAG=${GITHUB_SHA::7}" | tee -a $GITHUB_ENV + echo "IMAGE_TAGS=latest ${GITHUB_SHA::12}" | tee -a $GITHUB_ENV # https://github.com/redhat-actions/buildah-build#readme - name: Build from Dockerfile - id: image-build + id: build-image uses: redhat-actions/buildah-build@v2 with: image: ${{ env.APP_NAME }} - tags: ${{ env.TAG }} - # If you don't have a dockerfile, see: - # https://github.com/redhat-actions/buildah-build#scratch-build-inputs - # Otherwise, point this to your Dockerfile relative to the repository root. + tags: ${{ env.IMAGE_TAGS }} + + # If you don't have a Dockerfile/Containerfile, refer to https://github.com/redhat-actions/buildah-build#scratch-build-inputs + # Or, perform a source-to-image build using https://github.com/redhat-actions/s2i-build + # Otherwise, point this to your Dockerfile/Containerfile relative to the repository root. dockerfiles: | ./Dockerfile # https://github.com/redhat-actions/push-to-registry#readme - name: Push to registry - id: push-to-registry + id: push-image uses: redhat-actions/push-to-registry@v2 with: - image: ${{ steps.image-build.outputs.image }} - tags: ${{ steps.image-build.outputs.tags }} - registry: ${{ env.REGISTRY }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ env.IMAGE_REGISTRY_USER }} + password: ${{ env.IMAGE_REGISTRY_PASSWORD }} - # The path the image was pushed to is now stored in ${{ steps.push-to-registry.outputs.registry-path }} + # The path the image was pushed to is now stored in ${{ steps.push-image.outputs.registry-path }} - # oc-login works on all platforms, but oc must be installed first. - # The GitHub Ubuntu runner already includes oc. - # Otherwise, https://github.com/redhat-actions/openshift-tools-installer can be used to install oc, - # as well as many other tools. + - name: Install oc + uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: 4 # https://github.com/redhat-actions/oc-login#readme - name: Log in to OpenShift @@ -163,18 +169,19 @@ jobs: uses: redhat-actions/oc-new-app@v1 with: app_name: ${{ env.APP_NAME }} - image: ${{ steps.push-to-registry.outputs.registry-path }} + image: ${{ steps.push-image.outputs.registry-path }} namespace: ${{ env.OPENSHIFT_NAMESPACE }} port: ${{ env.APP_PORT }} - - name: View application route + - name: Print application URL + env: + ROUTE: ${{ steps.deploy-and-expose.outputs.route }} + SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }} run: | [[ -n ${{ env.ROUTE }} ]] || (echo "Determining application route failed in previous step"; exit 1) + echo echo "======================== Your application is available at: ========================" echo ${{ env.ROUTE }} echo "===================================================================================" echo echo "Your app can be taken down with: \"oc delete all --selector='${{ env.SELECTOR }}'\"" - env: - ROUTE: ${{ steps.deploy-and-expose.outputs.route }} - SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }} From 149cf11287e993f8144ff44dd688d69f1036d73e Mon Sep 17 00:00:00 2001 From: Tim Etchells Date: Tue, 14 Sep 2021 11:52:30 -0700 Subject: [PATCH 26/38] Update github-script major version Co-authored-by: John Bohannon --- deployments/openshift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/openshift.yml b/deployments/openshift.yml index fd090a8..46ff961 100644 --- a/deployments/openshift.yml +++ b/deployments/openshift.yml @@ -71,7 +71,7 @@ jobs: steps: - name: Check for required secrets - uses: actions/github-script@v3 + uses: actions/github-script@v4 with: script: | const secrets = { From 31751181512568e56185350649a5be65fb9c1523 Mon Sep 17 00:00:00 2001 From: Aparna Ravindra <82894348+aparna-ravindra@users.noreply.github.com> Date: Wed, 15 Sep 2021 20:02:11 +0530 Subject: [PATCH 27/38] Addressing review comments - Renaming template and updating setup-ruby action version (#1086) * renaming template and updating setup-ruby action version * renaming rubyrails files * renaming rails files --- ci/properties/rails-lint.properties.json | 6 ------ ci/properties/rubyonrails-lint.properties.json | 6 ++++++ ci/{rails-lint.yml => rubyonrails-lint.yml} | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 ci/properties/rails-lint.properties.json create mode 100644 ci/properties/rubyonrails-lint.properties.json rename ci/{rails-lint.yml => rubyonrails-lint.yml} (87%) diff --git a/ci/properties/rails-lint.properties.json b/ci/properties/rails-lint.properties.json deleted file mode 100644 index 7a109a1..0000000 --- a/ci/properties/rails-lint.properties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Rails - Build and Run Linters", - "description": "Build Rails application and run linters", - "iconName": "ruby", - "categories": ["Ruby", "Rails"] -} diff --git a/ci/properties/rubyonrails-lint.properties.json b/ci/properties/rubyonrails-lint.properties.json new file mode 100644 index 0000000..7dac469 --- /dev/null +++ b/ci/properties/rubyonrails-lint.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Rails - Install Dependencies and Run Linters", + "description": "Install dependencies and run linters on Rails application", + "iconName": "ruby", + "categories": ["Ruby", "Rails"] +} diff --git a/ci/rails-lint.yml b/ci/rubyonrails-lint.yml similarity index 87% rename from ci/rails-lint.yml rename to ci/rubyonrails-lint.yml index b2f8832..d95b70e 100644 --- a/ci/rails-lint.yml +++ b/ci/rubyonrails-lint.yml @@ -3,7 +3,7 @@ # separate terms of service, privacy policy, and support # documentation. # This workflow will download a prebuilt Ruby version, install dependencies, and run linters -name: Build Rails and run linters +name: Rails - Install dependencies and run linters on: push: @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v2 - name: Setup Ruby and install gems - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e with: bundler-cache: true # Add or Replace any other security checks here From dda42cb8f2514b6ee4e8cc0a860512821ffaa9f7 Mon Sep 17 00:00:00 2001 From: Aparna Ravindra <82894348+aparna-ravindra@users.noreply.github.com> Date: Wed, 15 Sep 2021 20:04:06 +0530 Subject: [PATCH 28/38] Addition to categories to python templates (#1088) * addition to categories for python-app template * adding categories to pylint template * adding categories to python-package template Co-authored-by: Ashwin Sangem --- ci/properties/pylint.properties.json | 2 +- ci/properties/python-app.properties.json | 2 +- ci/properties/python-package.properties.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/properties/pylint.properties.json b/ci/properties/pylint.properties.json index c7d1363..fc751ea 100644 --- a/ci/properties/pylint.properties.json +++ b/ci/properties/pylint.properties.json @@ -2,5 +2,5 @@ "name": "Pylint", "description": "Lint a Python application with pylint.", "iconName": "python", - "categories": ["Python"] + "categories": ["Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-app.properties.json b/ci/properties/python-app.properties.json index 34e4a57..add4d8b 100644 --- a/ci/properties/python-app.properties.json +++ b/ci/properties/python-app.properties.json @@ -2,5 +2,5 @@ "name": "Python application", "description": "Create and test a Python application.", "iconName": "python", - "categories": ["Python"] + "categories": ["Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-package.properties.json b/ci/properties/python-package.properties.json index 4e09d40..06052d9 100644 --- a/ci/properties/python-package.properties.json +++ b/ci/properties/python-package.properties.json @@ -2,5 +2,5 @@ "name": "Python package", "description": "Create and test a Python package on multiple Python versions.", "iconName": "python", - "categories": ["Python"] + "categories": ["Python", "Bottle", "Flask"] } From df5ac56102886236863a9123780741504ddeb9a1 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari <64764738+tiwarishub@users.noreply.github.com> Date: Thu, 16 Sep 2021 11:00:07 +0530 Subject: [PATCH 29/38] Adding category in the template property file (#1092) * adding category in the template property file * added category on ruby template --- ci/properties/ada.properties.json | 2 +- ci/properties/android.properties.json | 2 +- ci/properties/ant.properties.json | 2 +- ci/properties/c-cpp.properties.json | 2 +- ci/properties/clojure.properties.json | 2 +- ci/properties/cmake.properties.json | 2 +- ci/properties/crystal.properties.json | 2 +- ci/properties/d.properties.json | 2 +- ci/properties/dart.properties.json | 2 +- ci/properties/deno.properties.json | 2 +- ci/properties/django.properties.json | 2 +- ci/properties/docker-image.properties.json | 2 +- ci/properties/docker-publish.properties.json | 2 +- ci/properties/dotnet-desktop.properties.json | 2 +- ci/properties/dotnet.properties.json | 2 +- ci/properties/elixir.properties.json | 2 +- ci/properties/erlang.properties.json | 2 +- ci/properties/gem-push.properties.json | 2 +- ci/properties/go.properties.json | 2 +- ci/properties/gradle-publish.properties.json | 2 +- ci/properties/gradle.properties.json | 2 +- ci/properties/grunt.properties.json | 2 +- ci/properties/gulp.properties.json | 2 +- ci/properties/haskell.properties.json | 2 +- ci/properties/ios.properties.json | 1 + ci/properties/jekyll.properties.json | 2 +- ci/properties/laravel.properties.json | 1 + ci/properties/maven-publish.properties.json | 2 +- ci/properties/maven.properties.json | 2 +- ci/properties/msbuild.properties.json | 2 +- ci/properties/node.js.properties.json | 2 +- ci/properties/npm-publish.properties.json | 2 +- ci/properties/php.properties.json | 2 +- ci/properties/pylint.properties.json | 2 +- ci/properties/python-app.properties.json | 2 +- ci/properties/python-package-conda.properties.json | 2 +- ci/properties/python-package.properties.json | 2 +- ci/properties/python-publish.properties.json | 2 +- ci/properties/r.properties.json | 2 +- ci/properties/ruby.properties.json | 2 +- ci/properties/rubyonrails-lint.properties.json | 2 +- ci/properties/rust.properties.json | 2 +- ci/properties/scala.properties.json | 2 +- ci/properties/swift.properties.json | 2 +- ci/properties/webpack.properties.json | 2 +- deployments/properties/openshift.properties.json | 2 +- 46 files changed, 46 insertions(+), 44 deletions(-) diff --git a/ci/properties/ada.properties.json b/ci/properties/ada.properties.json index 71021d0..c4c2b3a 100644 --- a/ci/properties/ada.properties.json +++ b/ci/properties/ada.properties.json @@ -2,5 +2,5 @@ "name": "Ada", "description": "Build Ada project with GPRbuild.", "iconName": "ada", - "categories": ["Ada"] + "categories": ["Continuous integration", "Ada"] } diff --git a/ci/properties/android.properties.json b/ci/properties/android.properties.json index 29d293f..a3ff2cd 100644 --- a/ci/properties/android.properties.json +++ b/ci/properties/android.properties.json @@ -2,5 +2,5 @@ "name": "Android CI", "description": "Build an Android project with Gradle.", "iconName": "android", - "categories": ["Java", "Mobile"] + "categories": ["Continuous integration", "Java", "Mobile"] } diff --git a/ci/properties/ant.properties.json b/ci/properties/ant.properties.json index 5a4d7a9..93d5473 100644 --- a/ci/properties/ant.properties.json +++ b/ci/properties/ant.properties.json @@ -2,5 +2,5 @@ "name": "Java with Ant", "description": "Build and test a Java project with Apache Ant.", "iconName": "ant", - "categories": ["Ant", "Java"] + "categories": ["Continuous integration", "Ant", "Java"] } diff --git a/ci/properties/c-cpp.properties.json b/ci/properties/c-cpp.properties.json index 5d2a2df..2d214a4 100644 --- a/ci/properties/c-cpp.properties.json +++ b/ci/properties/c-cpp.properties.json @@ -2,5 +2,5 @@ "name": "C/C++ with Make", "description": "Build and test a C/C++ project using Make.", "iconName": "c-cpp", - "categories": ["C", "C++"] + "categories": ["Continuous integration", "C", "C++"] } diff --git a/ci/properties/clojure.properties.json b/ci/properties/clojure.properties.json index 5a9e3ed..f57dfdf 100644 --- a/ci/properties/clojure.properties.json +++ b/ci/properties/clojure.properties.json @@ -2,5 +2,5 @@ "name": "Clojure", "description": "Build and test a Clojure project with Leiningen.", "iconName": "clojure", - "categories": ["Clojure", "Java"] + "categories": ["Continuous integration", "Clojure", "Java"] } diff --git a/ci/properties/cmake.properties.json b/ci/properties/cmake.properties.json index ac001c3..a7f5d06 100644 --- a/ci/properties/cmake.properties.json +++ b/ci/properties/cmake.properties.json @@ -2,5 +2,5 @@ "name": "CMake based projects", "description": "Build and test a CMake based project.", "iconName": "cmake", - "categories": ["C", "C++"] + "categories": ["Continuous integration", "C", "C++"] } \ No newline at end of file diff --git a/ci/properties/crystal.properties.json b/ci/properties/crystal.properties.json index bb058f7..244adbf 100644 --- a/ci/properties/crystal.properties.json +++ b/ci/properties/crystal.properties.json @@ -2,5 +2,5 @@ "name": "Crystal", "description": "Build and test a Crystal project.", "iconName": "crystal", - "categories": ["Crystal"] + "categories": ["Continuous integration", "Crystal"] } diff --git a/ci/properties/d.properties.json b/ci/properties/d.properties.json index 5c67054..8e51aa3 100644 --- a/ci/properties/d.properties.json +++ b/ci/properties/d.properties.json @@ -2,5 +2,5 @@ "name": "D", "description": "Build and test a D project with dub.", "iconName": "d", - "categories": [ "D" ] + "categories": ["Continuous integration", "D"] } diff --git a/ci/properties/dart.properties.json b/ci/properties/dart.properties.json index 022a003..f4bf112 100644 --- a/ci/properties/dart.properties.json +++ b/ci/properties/dart.properties.json @@ -2,5 +2,5 @@ "name": "Dart", "description": "Build and test a Dart project with Pub.", "iconName": "dart", - "categories": ["Dart"] + "categories": ["Continuous integration", "Dart"] } diff --git a/ci/properties/deno.properties.json b/ci/properties/deno.properties.json index 8a2c762..6d4d653 100644 --- a/ci/properties/deno.properties.json +++ b/ci/properties/deno.properties.json @@ -2,5 +2,5 @@ "name": "Deno", "description": "Test your Deno project", "iconName": "deno", - "categories": ["JavaScript", "TypeScript", "Deno"] + "categories": ["Continuous integration", "JavaScript", "TypeScript", "Deno"] } diff --git a/ci/properties/django.properties.json b/ci/properties/django.properties.json index 3015441..791fb21 100644 --- a/ci/properties/django.properties.json +++ b/ci/properties/django.properties.json @@ -2,5 +2,5 @@ "name": "Django", "description": "Build and Test a Django Project", "iconName": "django", - "categories": ["Python", "Django"] + "categories": ["Continuous integration", "Python", "Django"] } diff --git a/ci/properties/docker-image.properties.json b/ci/properties/docker-image.properties.json index 8ad7552..b13144c 100644 --- a/ci/properties/docker-image.properties.json +++ b/ci/properties/docker-image.properties.json @@ -2,5 +2,5 @@ "name": "Docker image", "description": "Build a Docker image to deploy, run, or push to a registry.", "iconName": "docker", - "categories": ["Dockerfile"] + "categories": ["Continuous integration", "Dockerfile"] } diff --git a/ci/properties/docker-publish.properties.json b/ci/properties/docker-publish.properties.json index 1b36c0f..890f4af 100644 --- a/ci/properties/docker-publish.properties.json +++ b/ci/properties/docker-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Docker Container", "description": "Build, test and push Docker image to GitHub Packages.", "iconName": "docker", - "categories": ["Dockerfile"] + "categories": ["Continuous integration", "Dockerfile"] } diff --git a/ci/properties/dotnet-desktop.properties.json b/ci/properties/dotnet-desktop.properties.json index f6e1cb8..bbe9d10 100644 --- a/ci/properties/dotnet-desktop.properties.json +++ b/ci/properties/dotnet-desktop.properties.json @@ -2,5 +2,5 @@ "name": ".NET Desktop", "description": "Build, test, sign and publish a desktop application built on .NET.", "iconName": "dotnet", - "categories": ["C#", "Visual Basic", "WPF", ".NET"] + "categories": ["Continuous integration", "C#", "Visual Basic", "WPF", ".NET"] } \ No newline at end of file diff --git a/ci/properties/dotnet.properties.json b/ci/properties/dotnet.properties.json index b3feafb..d4f6eb2 100644 --- a/ci/properties/dotnet.properties.json +++ b/ci/properties/dotnet.properties.json @@ -2,5 +2,5 @@ "name": ".NET", "description": "Build and test a .NET or ASP.NET Core project.", "iconName": "dotnet", - "categories": ["C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET"] + "categories": ["Continuous integration", "C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET"] } diff --git a/ci/properties/elixir.properties.json b/ci/properties/elixir.properties.json index 572992d..6de4ea0 100644 --- a/ci/properties/elixir.properties.json +++ b/ci/properties/elixir.properties.json @@ -2,5 +2,5 @@ "name": "Elixir", "description": "Build and test an Elixir project with Mix.", "iconName": "elixir", - "categories": ["Elixir", "Erlang"] + "categories": ["Continuous integration", "Elixir", "Erlang"] } diff --git a/ci/properties/erlang.properties.json b/ci/properties/erlang.properties.json index d712b05..eba9af6 100644 --- a/ci/properties/erlang.properties.json +++ b/ci/properties/erlang.properties.json @@ -2,5 +2,5 @@ "name": "Erlang", "description": "Build and test an Erlang project with rebar.", "iconName": "erlang", - "categories": ["Erlang"] + "categories": ["Continuous integration", "Erlang"] } diff --git a/ci/properties/gem-push.properties.json b/ci/properties/gem-push.properties.json index 188d80a..0002ac5 100644 --- a/ci/properties/gem-push.properties.json +++ b/ci/properties/gem-push.properties.json @@ -2,5 +2,5 @@ "name": "Ruby Gem", "description": "Pushes a Ruby Gem to RubyGems and GitHub Package Registry.", "iconName": "ruby-gems", - "categories": ["Ruby"] + "categories": ["Continuous integration", "Ruby"] } diff --git a/ci/properties/go.properties.json b/ci/properties/go.properties.json index b96c0a1..1187f94 100644 --- a/ci/properties/go.properties.json +++ b/ci/properties/go.properties.json @@ -2,5 +2,5 @@ "name": "Go", "description": "Build a Go project.", "iconName": "go", - "categories": ["Go"] + "categories": ["Continuous integration", "Go"] } diff --git a/ci/properties/gradle-publish.properties.json b/ci/properties/gradle-publish.properties.json index 3ec3f4f..0155310 100644 --- a/ci/properties/gradle-publish.properties.json +++ b/ci/properties/gradle-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Java Package with Gradle", "description": "Build a Java Package using Gradle and publish to GitHub Packages.", "iconName": "gradle", - "categories": ["Java", "Gradle", "Spring", "JSF"] + "categories": ["Continuous integration", "Java", "Gradle", "Spring", "JSF"] } \ No newline at end of file diff --git a/ci/properties/gradle.properties.json b/ci/properties/gradle.properties.json index c90f78f..47d1ddb 100644 --- a/ci/properties/gradle.properties.json +++ b/ci/properties/gradle.properties.json @@ -2,5 +2,5 @@ "name": "Java with Gradle", "description": "Build and test a Java project using a Gradle wrapper script.", "iconName": "gradle", - "categories": ["Java", "Gradle", "Spring", "JSF"] + "categories": ["Continuous integration", "Java", "Gradle", "Spring", "JSF"] } diff --git a/ci/properties/grunt.properties.json b/ci/properties/grunt.properties.json index c8a5b9f..34a0a35 100644 --- a/ci/properties/grunt.properties.json +++ b/ci/properties/grunt.properties.json @@ -2,5 +2,5 @@ "name": "Grunt", "description": "Build a NodeJS project with npm and grunt.", "iconName": "grunt", - "categories": ["JavaScript", "TypeScript", "npm", "Grunt"] + "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Grunt"] } diff --git a/ci/properties/gulp.properties.json b/ci/properties/gulp.properties.json index 658325b..3b4201a 100644 --- a/ci/properties/gulp.properties.json +++ b/ci/properties/gulp.properties.json @@ -2,5 +2,5 @@ "name": "Gulp", "description": "Build a NodeJS project with npm and gulp.", "iconName": "gulp", - "categories": ["JavaScript", "TypeScript", "npm", "Gulp"] + "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Gulp"] } diff --git a/ci/properties/haskell.properties.json b/ci/properties/haskell.properties.json index 2dedbf2..798d3d0 100644 --- a/ci/properties/haskell.properties.json +++ b/ci/properties/haskell.properties.json @@ -2,5 +2,5 @@ "name": "Haskell", "description": "Build and test a Haskell project with Cabal.", "iconName": "haskell", - "categories": ["Haskell"] + "categories": ["Continuous integration", "Haskell"] } diff --git a/ci/properties/ios.properties.json b/ci/properties/ios.properties.json index 0b3a9ed..f88edc9 100644 --- a/ci/properties/ios.properties.json +++ b/ci/properties/ios.properties.json @@ -3,6 +3,7 @@ "description": "Build and test an iOS application using xcodebuild and any available iPhone simulator.", "iconName": "xcode", "categories": [ + "Continuous integration", "iOS", "Xcode" ] diff --git a/ci/properties/jekyll.properties.json b/ci/properties/jekyll.properties.json index 38cc6cd..bbe279c 100644 --- a/ci/properties/jekyll.properties.json +++ b/ci/properties/jekyll.properties.json @@ -2,5 +2,5 @@ "name": "Jekyll", "description": "Package a Jekyll site using the jekyll/builder Docker image.", "iconName": "jekyll", - "categories": ["HTML"] + "categories": ["Continuous integration", "HTML"] } diff --git a/ci/properties/laravel.properties.json b/ci/properties/laravel.properties.json index f10a462..1c2e433 100644 --- a/ci/properties/laravel.properties.json +++ b/ci/properties/laravel.properties.json @@ -3,6 +3,7 @@ "description": "Test a Laravel project.", "iconName": "php", "categories": [ + "Continuous integration", "PHP", "Laravel" ] diff --git a/ci/properties/maven-publish.properties.json b/ci/properties/maven-publish.properties.json index 41f2915..2bc750f 100644 --- a/ci/properties/maven-publish.properties.json +++ b/ci/properties/maven-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Java Package with Maven", "description": "Build a Java Package using Maven and publish to GitHub Packages.", "iconName": "maven", - "categories": ["Java", "Maven", "Spring", "JSF"] + "categories": ["Continuous integration", "Java", "Maven", "Spring", "JSF"] } \ No newline at end of file diff --git a/ci/properties/maven.properties.json b/ci/properties/maven.properties.json index 4086470..be8f7bf 100644 --- a/ci/properties/maven.properties.json +++ b/ci/properties/maven.properties.json @@ -2,5 +2,5 @@ "name": "Java with Maven", "description": "Build and test a Java project with Apache Maven.", "iconName": "maven", - "categories": ["Java", "Maven", "Spring", "JSF"] + "categories": ["Continuous integration", "Java", "Maven", "Spring", "JSF"] } diff --git a/ci/properties/msbuild.properties.json b/ci/properties/msbuild.properties.json index b90cad8..c189be2 100644 --- a/ci/properties/msbuild.properties.json +++ b/ci/properties/msbuild.properties.json @@ -2,5 +2,5 @@ "name": "MSBuild based projects", "description": "Build a MSBuild based project.", "iconName": "c-cpp", - "categories": ["C", "C++"] + "categories": ["Continuous integration", "C", "C++"] } \ No newline at end of file diff --git a/ci/properties/node.js.properties.json b/ci/properties/node.js.properties.json index c982d17..32f5306 100644 --- a/ci/properties/node.js.properties.json +++ b/ci/properties/node.js.properties.json @@ -2,5 +2,5 @@ "name": "Node.js", "description": "Build and test a Node.js project with npm.", "iconName": "nodejs", - "categories": ["JavaScript", "npm", "React", "Angular"] + "categories": ["Continuous integration", "JavaScript", "npm", "React", "Angular"] } diff --git a/ci/properties/npm-publish.properties.json b/ci/properties/npm-publish.properties.json index 764dbf3..9371d7b 100644 --- a/ci/properties/npm-publish.properties.json +++ b/ci/properties/npm-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Node.js Package", "description": "Publishes a Node.js package to npm and GitHub Packages.", "iconName": "node-package-transparent", - "categories": ["JavaScript", "npm"] + "categories": ["Continuous integration", "JavaScript", "npm"] } diff --git a/ci/properties/php.properties.json b/ci/properties/php.properties.json index 641e536..f345a28 100644 --- a/ci/properties/php.properties.json +++ b/ci/properties/php.properties.json @@ -2,5 +2,5 @@ "name": "PHP", "description": "Build and test a PHP application using Composer", "iconName": "php", - "categories": ["PHP", "Composer"] + "categories": ["Continuous integration", "PHP", "Composer"] } \ No newline at end of file diff --git a/ci/properties/pylint.properties.json b/ci/properties/pylint.properties.json index fc751ea..23c15dc 100644 --- a/ci/properties/pylint.properties.json +++ b/ci/properties/pylint.properties.json @@ -2,5 +2,5 @@ "name": "Pylint", "description": "Lint a Python application with pylint.", "iconName": "python", - "categories": ["Python", "Bottle", "Flask"] + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-app.properties.json b/ci/properties/python-app.properties.json index add4d8b..1229b29 100644 --- a/ci/properties/python-app.properties.json +++ b/ci/properties/python-app.properties.json @@ -2,5 +2,5 @@ "name": "Python application", "description": "Create and test a Python application.", "iconName": "python", - "categories": ["Python", "Bottle", "Flask"] + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-package-conda.properties.json b/ci/properties/python-package-conda.properties.json index 1f6436d..5600766 100644 --- a/ci/properties/python-package-conda.properties.json +++ b/ci/properties/python-package-conda.properties.json @@ -2,5 +2,5 @@ "name": "Python Package using Anaconda", "description": "Create and test a Python package on multiple Python versions using Anaconda for package management.", "iconName": "python", - "categories": ["Python"] + "categories": ["Continuous integration", "Python"] } diff --git a/ci/properties/python-package.properties.json b/ci/properties/python-package.properties.json index 06052d9..8c9dbcf 100644 --- a/ci/properties/python-package.properties.json +++ b/ci/properties/python-package.properties.json @@ -2,5 +2,5 @@ "name": "Python package", "description": "Create and test a Python package on multiple Python versions.", "iconName": "python", - "categories": ["Python", "Bottle", "Flask"] + "categories": ["Continuous integration", "Python", "Bottle", "Flask"] } diff --git a/ci/properties/python-publish.properties.json b/ci/properties/python-publish.properties.json index 4fd9ece..9219e0f 100644 --- a/ci/properties/python-publish.properties.json +++ b/ci/properties/python-publish.properties.json @@ -2,5 +2,5 @@ "name": "Publish Python Package", "description": "Publish a Python Package to PyPI on release.", "iconName": "python", - "categories": ["Python"] + "categories": ["Continuous integration", "Python"] } diff --git a/ci/properties/r.properties.json b/ci/properties/r.properties.json index 84ba0ec..9f83a25 100644 --- a/ci/properties/r.properties.json +++ b/ci/properties/r.properties.json @@ -2,5 +2,5 @@ "name": "R package", "description": "Create and test an R package on multiple R versions.", "iconName": "r", - "categories": ["R"] + "categories": ["Continuous integration", "R"] } diff --git a/ci/properties/ruby.properties.json b/ci/properties/ruby.properties.json index 904f12f..894436b 100644 --- a/ci/properties/ruby.properties.json +++ b/ci/properties/ruby.properties.json @@ -2,5 +2,5 @@ "name": "Ruby", "description": "Build and test a Ruby project with Rake.", "iconName": "ruby", - "categories": ["Ruby"] + "categories": ["Continuous integration", "Ruby"] } diff --git a/ci/properties/rubyonrails-lint.properties.json b/ci/properties/rubyonrails-lint.properties.json index 7dac469..e6e5f69 100644 --- a/ci/properties/rubyonrails-lint.properties.json +++ b/ci/properties/rubyonrails-lint.properties.json @@ -2,5 +2,5 @@ "name": "Rails - Install Dependencies and Run Linters", "description": "Install dependencies and run linters on Rails application", "iconName": "ruby", - "categories": ["Ruby", "Rails"] + "categories": ["Continuous integration", "Ruby", "Rails"] } diff --git a/ci/properties/rust.properties.json b/ci/properties/rust.properties.json index 3a6dc02..3e834d9 100644 --- a/ci/properties/rust.properties.json +++ b/ci/properties/rust.properties.json @@ -2,5 +2,5 @@ "name": "Rust", "description": "Build and test a Rust project with Cargo.", "iconName": "rust", - "categories": ["Rust"] + "categories": ["Continuous integration", "Rust"] } \ No newline at end of file diff --git a/ci/properties/scala.properties.json b/ci/properties/scala.properties.json index a92fc73..34dde26 100644 --- a/ci/properties/scala.properties.json +++ b/ci/properties/scala.properties.json @@ -2,5 +2,5 @@ "name": "Scala", "description": "Build and test a Scala project with SBT.", "iconName": "scala", - "categories": ["Scala", "Java"] + "categories": ["Continuous integration", "Scala", "Java"] } diff --git a/ci/properties/swift.properties.json b/ci/properties/swift.properties.json index 9efd645..b26a264 100644 --- a/ci/properties/swift.properties.json +++ b/ci/properties/swift.properties.json @@ -2,5 +2,5 @@ "name": "Swift", "description": "Build and test a Swift Package.", "iconName": "swift", - "categories": ["Swift"] + "categories": ["Continuous integration", "Swift"] } diff --git a/ci/properties/webpack.properties.json b/ci/properties/webpack.properties.json index 1e22ccb..6d8b1a5 100644 --- a/ci/properties/webpack.properties.json +++ b/ci/properties/webpack.properties.json @@ -2,5 +2,5 @@ "name": "Webpack", "description": "Build a NodeJS project with npm and webpack.", "iconName": "webpack", - "categories": ["JavaScript", "TypeScript", "npm", "Webpack"] + "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Webpack"] } diff --git a/deployments/properties/openshift.properties.json b/deployments/properties/openshift.properties.json index 54948c2..d08351f 100644 --- a/deployments/properties/openshift.properties.json +++ b/deployments/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","Deployment" ] + "categories": ["Deployment", "Dockerfile"] } From 1cb322141e9482ee44e8a2756fd4dbc0135696aa Mon Sep 17 00:00:00 2001 From: Ninad Kavimandan Date: Thu, 16 Sep 2021 11:02:21 +0530 Subject: [PATCH 30/38] add `makefile` template (#1093) Co-authored-by: Ashwin Sangem --- ci/makefile.yml | 27 ++++++++++++++++++++++++++ ci/properties/makefile.properties.json | 6 ++++++ icons/makefile.svg | 1 + 3 files changed, 34 insertions(+) create mode 100644 ci/makefile.yml create mode 100644 ci/properties/makefile.properties.json create mode 100644 icons/makefile.svg diff --git a/ci/makefile.yml b/ci/makefile.yml new file mode 100644 index 0000000..eafe622 --- /dev/null +++ b/ci/makefile.yml @@ -0,0 +1,27 @@ +name: Makefile CI + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: configure + run: ./configure + + - name: Install dependencies + run: make + + - name: Run check + run: make check + + - name: Run distcheck + run: make distcheck diff --git a/ci/properties/makefile.properties.json b/ci/properties/makefile.properties.json new file mode 100644 index 0000000..93ecf1e --- /dev/null +++ b/ci/properties/makefile.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Build projects with Make", + "description": "Build and test a project using Make.", + "iconName": "makefile", + "categories": ["Makefile"] +} diff --git a/icons/makefile.svg b/icons/makefile.svg new file mode 100644 index 0000000..694ad2e --- /dev/null +++ b/icons/makefile.svg @@ -0,0 +1 @@ + \ No newline at end of file From 9095e7c9d55b5b9aca2cce211f0a7d6b4fe14371 Mon Sep 17 00:00:00 2001 From: Ninad Kavimandan Date: Thu, 16 Sep 2021 11:17:56 +0530 Subject: [PATCH 31/38] added prefix `npm-` (#1097) --- ci/{grunt.yml => npm-grunt.yml} | 0 ci/{gulp.yml => npm-gulp.yml} | 0 .../{grunt.properties.json => npm-grunt.properties.json} | 0 ci/properties/{gulp.properties.json => npm-gulp.properties.json} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename ci/{grunt.yml => npm-grunt.yml} (100%) rename ci/{gulp.yml => npm-gulp.yml} (100%) rename ci/properties/{grunt.properties.json => npm-grunt.properties.json} (100%) rename ci/properties/{gulp.properties.json => npm-gulp.properties.json} (100%) diff --git a/ci/grunt.yml b/ci/npm-grunt.yml similarity index 100% rename from ci/grunt.yml rename to ci/npm-grunt.yml diff --git a/ci/gulp.yml b/ci/npm-gulp.yml similarity index 100% rename from ci/gulp.yml rename to ci/npm-gulp.yml diff --git a/ci/properties/grunt.properties.json b/ci/properties/npm-grunt.properties.json similarity index 100% rename from ci/properties/grunt.properties.json rename to ci/properties/npm-grunt.properties.json diff --git a/ci/properties/gulp.properties.json b/ci/properties/npm-gulp.properties.json similarity index 100% rename from ci/properties/gulp.properties.json rename to ci/properties/npm-gulp.properties.json From 59daabb07b45f661e2931ea36d8f8a1e42963aa8 Mon Sep 17 00:00:00 2001 From: Ninad Kavimandan Date: Thu, 16 Sep 2021 11:19:17 +0530 Subject: [PATCH 32/38] support `AspNetCore` and `DotNetConsole` (#1096) Co-authored-by: Ashwin Sangem --- ci/properties/dotnet.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/dotnet.properties.json b/ci/properties/dotnet.properties.json index d4f6eb2..1a46604 100644 --- a/ci/properties/dotnet.properties.json +++ b/ci/properties/dotnet.properties.json @@ -2,5 +2,5 @@ "name": ".NET", "description": "Build and test a .NET or ASP.NET Core project.", "iconName": "dotnet", - "categories": ["Continuous integration", "C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET"] + "categories": ["Continuous integration", "C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET", "AspNetCore", "DotNetConsole"] } From c36ea2c5605bf159b7a6ca8b8bc97c410accc036 Mon Sep 17 00:00:00 2001 From: Ninad Kavimandan Date: Thu, 16 Sep 2021 11:51:53 +0530 Subject: [PATCH 33/38] add `Continuous integration` to makefile props (#1100) --- ci/properties/makefile.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/makefile.properties.json b/ci/properties/makefile.properties.json index 93ecf1e..209bf70 100644 --- a/ci/properties/makefile.properties.json +++ b/ci/properties/makefile.properties.json @@ -2,5 +2,5 @@ "name": "Build projects with Make", "description": "Build and test a project using Make.", "iconName": "makefile", - "categories": ["Makefile"] + "categories": ["Continuous integration", "Makefile"] } From 6dfa11d0c4c966b00c10cab65d484232008ec9cb Mon Sep 17 00:00:00 2001 From: Cadu Ribeiro Date: Fri, 17 Sep 2021 17:58:46 -0300 Subject: [PATCH 34/38] Add github/super-linter as starter workflow on CI (#1089) This commit adds github/super-linter as a starter workflow to execute several linters based on the user codebase on changed files. Co-authored-by: Josh Gross --- ci/properties/super-linter.properties.json | 6 +++++ ci/super-linter.yml | 29 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 ci/properties/super-linter.properties.json create mode 100644 ci/super-linter.yml diff --git a/ci/properties/super-linter.properties.json b/ci/properties/super-linter.properties.json new file mode 100644 index 0000000..e070300 --- /dev/null +++ b/ci/properties/super-linter.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Super Linter - Run Linters for several languages", + "description": "Run linters for several languages on your code base for changed files", + "iconName": "octicon check-circle", + "categories": ["code-quality", "code-review"] +} diff --git a/ci/super-linter.yml b/ci/super-linter.yml new file mode 100644 index 0000000..bebd82d --- /dev/null +++ b/ci/super-linter.yml @@ -0,0 +1,29 @@ +# This workflow executes several linters on changed files based on languages used in your code base whenever +# you push a code or open a pull request. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/github/super-linter +name: Lint Code Base + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] +jobs: + run-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: $default-branch + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e4091f2f55dfbfcd692d8e6444562bf0bd7e4e06 Mon Sep 17 00:00:00 2001 From: Ninad Kavimandan Date: Tue, 21 Sep 2021 13:35:26 +0530 Subject: [PATCH 35/38] add `Vue` to nodejs props (#1109) --- ci/properties/node.js.properties.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/properties/node.js.properties.json b/ci/properties/node.js.properties.json index 32f5306..7f68d88 100644 --- a/ci/properties/node.js.properties.json +++ b/ci/properties/node.js.properties.json @@ -2,5 +2,5 @@ "name": "Node.js", "description": "Build and test a Node.js project with npm.", "iconName": "nodejs", - "categories": ["Continuous integration", "JavaScript", "npm", "React", "Angular"] + "categories": ["Continuous integration", "JavaScript", "npm", "React", "Angular", "Vue"] } From 55f65bcc15417680dcd248f288c788a0879a0db4 Mon Sep 17 00:00:00 2001 From: Fernando de Oliveira <5161098+fedeoliv@users.noreply.github.com> Date: Wed, 22 Sep 2021 08:07:22 -0300 Subject: [PATCH 36/38] Directory structure updated (#1112) Co-authored-by: Fernando de Oliveira <5161098+fernandoBRS@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b5b9f8..77506d4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ These are the workflow files for helping people get started with GitHub Actions. ### Directory structure -* [ci](ci): solutions for Continuous Integration and Deployments +* [ci](ci): solutions for Continuous Integration workflows. +* [deployments](deployments): solutions for Deployment workflows. * [automation](automation): solutions for automating workflows. * [code-scanning](code-scanning): starter workflows for [Code Scanning](https://github.com/features/security) * [icons](icons): svg icons for the relevant template From 5a1343bb22091fcb394e257bbfd53a5be55cabd9 Mon Sep 17 00:00:00 2001 From: Aparna Ravindra <82894348+aparna-ravindra@users.noreply.github.com> Date: Thu, 23 Sep 2021 10:29:50 +0530 Subject: [PATCH 37/38] Adding template - Build Xcode project (#1095) * adding build for xcode * renaming template Co-authored-by: Ashwin Sangem --- ci/objective-c-xcode.yml | 30 +++++++++++++++++++ .../objective-c-xcode.properties.json | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 ci/objective-c-xcode.yml create mode 100644 ci/properties/objective-c-xcode.properties.json diff --git a/ci/objective-c-xcode.yml b/ci/objective-c-xcode.yml new file mode 100644 index 0000000..db009b0 --- /dev/null +++ b/ci/objective-c-xcode.yml @@ -0,0 +1,30 @@ +name: Xcode - Build and Analyze + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + name: Build and analyse default scheme using xcodebuild command + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + - name: Build + env: + scheme: ${{ 'default' }} + run: | + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild clean build analyze -scheme "$scheme" -"$filetype_parameter" "$file_to_build" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/ci/properties/objective-c-xcode.properties.json b/ci/properties/objective-c-xcode.properties.json new file mode 100644 index 0000000..e6068fe --- /dev/null +++ b/ci/properties/objective-c-xcode.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Xcode - Build and Analyze", + "description": "Build Xcode project using xcodebuild", + "iconName": "xcode", + "categories": ["Continuous integration", "Xcode", "Objective-C"] +} From 4a9a1680df0712aead69b443e6f41ef5a3aaff80 Mon Sep 17 00:00:00 2001 From: Randy Kleinman <76182417+rkleinman-hpe@users.noreply.github.com> Date: Fri, 24 Sep 2021 17:05:34 -0500 Subject: [PATCH 38/38] Update README grammar (#1123) substitue -> substitute --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77506d4..f39892f 100644 --- a/README.md +++ b/README.md @@ -45,5 +45,5 @@ For example: `ci/django.yml` and `ci/properties/django.properties.json`. These variables can be placed in the starter workflow and will be substituted as detailed below: * `$default-branch`: will substitute the branch from the repository, for example `main` and `master` -* `$protected-branches`: will substitue any protected branches from the repository. +* `$protected-branches`: will substitute any protected branches from the repository * `$cron-daily`: will substitute a valid but random time within the day