From 9390e82e4f1e1a0bde22ad22689ad702390253df Mon Sep 17 00:00:00 2001 From: dbartalos <6267612+dbartalos@users.noreply.github.com> Date: Mon, 11 Sep 2023 17:21:03 +0100 Subject: [PATCH 01/21] docs: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ac76ff..45c5fdf 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can find specific examples and available variables inside [each module folde ```hcl module "cloud-run-api-my-awesome-api" { - source = "github.com/NandosUK/infrastructure/terraform-modules/gcp/cloud-run-v1" + source = "github.com/NandosUK/infrastructure-terraform-modules/gcp/cloud-run-v1" project_id = "my-gcp-project-id" name = "my-awesome-api" (...) From 5e71fb908883412d75c1056001d9346dfc949249 Mon Sep 17 00:00:00 2001 From: dbartalos <6267612+dbartalos@users.noreply.github.com> Date: Mon, 11 Sep 2023 17:24:38 +0100 Subject: [PATCH 02/21] docs: change example reference to cloud-run-v2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45c5fdf..2323a61 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can find specific examples and available variables inside [each module folde ```hcl module "cloud-run-api-my-awesome-api" { - source = "github.com/NandosUK/infrastructure-terraform-modules/gcp/cloud-run-v1" + source = "github.com/NandosUK/infrastructure-terraform-modules/gcp/cloud-run-v2" project_id = "my-gcp-project-id" name = "my-awesome-api" (...) From 89eafbc662f7070fce5e5f4e5846cfce9a946bd1 Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 11 Sep 2023 18:58:44 +0200 Subject: [PATCH 03/21] little changes --- test/gcp/cloud-run-v2.tf | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/test/gcp/cloud-run-v2.tf b/test/gcp/cloud-run-v2.tf index 1f13108..2219598 100644 --- a/test/gcp/cloud-run-v2.tf +++ b/test/gcp/cloud-run-v2.tf @@ -31,28 +31,21 @@ module "cloud-run-api-my-awesome-api" { } eventarc_triggers = [ { - event_type = "google.cloud.firestore.document.v1.created", - api_path = "/api/my-trigger-receiver" - }, { - - event_type = "google.cloud.firestore.document.v1.updated", - api_path = "/api/my-trigger-receiver" - - }, { - - event_type = "google.cloud.firestore.document.v1.created", - api_path = "/api/my-trigger-receiver" - - }, { - - event_type = "google.cloud.firestore.document.v1.deleted", - api_path = "/api/my-trigger-receiver" - - }, { - - event_type = "google.cloud.firestore.document.v1.written", - api_path = "/api/my-trigger-receiver" - + api_path = "/api/my-trigger-receiver" + event_data_content_type = "application/protobuf" + + matching_criteria = [{ + attribute = "type" + value = "google.cloud.firestore.document.v1.created", + operator = "EXACT" + }, + { + attribute = "database" + value = "(default)" + operator = "EXACT" + }] } ] } + + From 405df7065b52287e29aa9b4fc4b35fdf2e8ed7a0 Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 11 Sep 2023 19:00:00 +0200 Subject: [PATCH 04/21] dynamic vars --- gcp/cloud-run-v2/main.tf | 3 ++- gcp/cloud-run-v2/variables.tf | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcp/cloud-run-v2/main.tf b/gcp/cloud-run-v2/main.tf index d9e6dda..b21f563 100644 --- a/gcp/cloud-run-v2/main.tf +++ b/gcp/cloud-run-v2/main.tf @@ -219,9 +219,10 @@ resource "google_eventarc_trigger" "default" { content { attribute = matching_criteria.value.attribute value = matching_criteria.value.value + operator = matching_criteria.value.operator } } - event_data_content_type = "application/protobuf" + event_data_content_type = each.value.event_data_content_type service_account = var.cloud_run_service_account destination { cloud_run_service { diff --git a/gcp/cloud-run-v2/variables.tf b/gcp/cloud-run-v2/variables.tf index e26a456..b518928 100644 --- a/gcp/cloud-run-v2/variables.tf +++ b/gcp/cloud-run-v2/variables.tf @@ -201,9 +201,8 @@ variable "cloud_armor" { variable "eventarc_triggers" { description = "Configuration for Eventarc triggers" - event_data_content_type = "string" type = list(object({ - event_type = string + event_data_content_type = string api_path = string matching_criteria = list(object({ attribute = string From e8b2bcce47c33aa655c4ac82158b91498a5787f0 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 12 Sep 2023 09:39:21 +0200 Subject: [PATCH 05/21] cleaning --- gcp/cloud-run-v2/main.tf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gcp/cloud-run-v2/main.tf b/gcp/cloud-run-v2/main.tf index b21f563..1482529 100644 --- a/gcp/cloud-run-v2/main.tf +++ b/gcp/cloud-run-v2/main.tf @@ -206,14 +206,6 @@ resource "google_eventarc_trigger" "default" { name = "trigger-${google_cloud_run_v2_service.default.name}" location = var.project_region - /* matching_criteria { - attribute = "type" - value = each.value.event_type - } - matching_criteria { - attribute = "database" - value = "(default)" - } */ dynamic "matching_criteria" { for_each = each.value.matching_criteria content { From 608d8aca7307c71295807d3270f7884a334d29d0 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 12 Sep 2023 09:55:38 +0200 Subject: [PATCH 06/21] operator = optional(string) --- gcp/cloud-run-v2/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/cloud-run-v2/variables.tf b/gcp/cloud-run-v2/variables.tf index b518928..15d5845 100644 --- a/gcp/cloud-run-v2/variables.tf +++ b/gcp/cloud-run-v2/variables.tf @@ -207,7 +207,7 @@ variable "eventarc_triggers" { matching_criteria = list(object({ attribute = string value = string - operator = string + operator = optional(string) })) })) default = [] From dd674ed8c9dde726093e02f394e541faedee7bdc Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 12 Sep 2023 10:22:54 +0200 Subject: [PATCH 07/21] documentation --- gcp/cloud-run-v2/README.md | 8 ++++++++ test/gcp/cloud-run-v2.tf | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcp/cloud-run-v2/README.md b/gcp/cloud-run-v2/README.md index a2315a2..68d966e 100644 --- a/gcp/cloud-run-v2/README.md +++ b/gcp/cloud-run-v2/README.md @@ -30,6 +30,14 @@ This updated Terraform module provides a comprehensive set of reusable configura - **SSL and Domain** : Optional SSL and custom domain settings. +### EventArc Trigger + +Key elements description: + +- **matching_criteria** : matching criteria for the trigger, including attributes like "attribute," "value", and "operator" to filter specific events. +- **event_data_content_type** : Sets the event's content type. +- **path** : to specify the URL path that will be appended to the service's base URL + ### Cloud Build Trigger - **Advanced Trigger Config** : More granular control over Cloud Build triggers. diff --git a/test/gcp/cloud-run-v2.tf b/test/gcp/cloud-run-v2.tf index 2219598..da74009 100644 --- a/test/gcp/cloud-run-v2.tf +++ b/test/gcp/cloud-run-v2.tf @@ -37,12 +37,10 @@ module "cloud-run-api-my-awesome-api" { matching_criteria = [{ attribute = "type" value = "google.cloud.firestore.document.v1.created", - operator = "EXACT" }, { attribute = "database" value = "(default)" - operator = "EXACT" }] } ] From f0248be2aa4da01776769b92d267e77cfde2ebb5 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 12 Sep 2023 10:49:06 +0200 Subject: [PATCH 08/21] doc little change --- gcp/cloud-run-v2/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcp/cloud-run-v2/README.md b/gcp/cloud-run-v2/README.md index 68d966e..14c6901 100644 --- a/gcp/cloud-run-v2/README.md +++ b/gcp/cloud-run-v2/README.md @@ -34,9 +34,9 @@ This updated Terraform module provides a comprehensive set of reusable configura Key elements description: -- **matching_criteria** : matching criteria for the trigger, including attributes like "attribute," "value", and "operator" to filter specific events. +- **matching_criteria** : matching criteria for the trigger, including attributes like "attribute," "value", and "operator"(optional) to filter specific events. - **event_data_content_type** : Sets the event's content type. -- **path** : to specify the URL path that will be appended to the service's base URL +- **api_path** : to specify the URL path that will be appended to the service's base URL ### Cloud Build Trigger From a3a9e5352e474b813e5cd6586aa303195ed0ca92 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 12 Sep 2023 11:57:05 +0200 Subject: [PATCH 09/21] cloud_armor dynamic --- gcp/cloud-run-v2/main.tf | 2 +- test/gcp/cloud-run-v2.tf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gcp/cloud-run-v2/main.tf b/gcp/cloud-run-v2/main.tf index 1482529..7f879b0 100644 --- a/gcp/cloud-run-v2/main.tf +++ b/gcp/cloud-run-v2/main.tf @@ -1,5 +1,5 @@ locals { - cloud_armor_rules = fileexists(var.cloud_armor.rules_file_path) ? yamldecode(file(var.cloud_armor.rules_file_path)) : [] + cloud_armor_rules = var.cloud_armor.enabled ? yamldecode(file(var.cloud_armor.rules_file_path)) : [] } # Resource configuration for deploying a Google Cloud Run service diff --git a/test/gcp/cloud-run-v2.tf b/test/gcp/cloud-run-v2.tf index da74009..5cf0d75 100644 --- a/test/gcp/cloud-run-v2.tf +++ b/test/gcp/cloud-run-v2.tf @@ -33,7 +33,6 @@ module "cloud-run-api-my-awesome-api" { { api_path = "/api/my-trigger-receiver" event_data_content_type = "application/protobuf" - matching_criteria = [{ attribute = "type" value = "google.cloud.firestore.document.v1.created", From e314233e556510c946ee2fc8898f4a13bafbdcc2 Mon Sep 17 00:00:00 2001 From: Sam Royal Date: Tue, 12 Sep 2023 10:59:59 +0100 Subject: [PATCH 10/21] Fix build --- gcp/cloud-run-v2/variables.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/gcp/cloud-run-v2/variables.tf b/gcp/cloud-run-v2/variables.tf index e26a456..6958aa5 100644 --- a/gcp/cloud-run-v2/variables.tf +++ b/gcp/cloud-run-v2/variables.tf @@ -201,7 +201,6 @@ variable "cloud_armor" { variable "eventarc_triggers" { description = "Configuration for Eventarc triggers" - event_data_content_type = "string" type = list(object({ event_type = string api_path = string From 84222122346f6fb79b38c83d02f5d5972655cbc0 Mon Sep 17 00:00:00 2001 From: Sam Royal Date: Tue, 12 Sep 2023 11:15:10 +0100 Subject: [PATCH 11/21] Add default path --- gcp/cloud-run-v2/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/cloud-run-v2/variables.tf b/gcp/cloud-run-v2/variables.tf index 6958aa5..3312c83 100644 --- a/gcp/cloud-run-v2/variables.tf +++ b/gcp/cloud-run-v2/variables.tf @@ -195,7 +195,7 @@ variable "cloud_armor" { }) default = { enabled = false - rules_file_path = "" + rules_file_path = "assets/cloud-armor-rules.yaml" } } From 0616739b3d08b14fc291b85c97df909fc769c0d7 Mon Sep 17 00:00:00 2001 From: Sam Royal Date: Tue, 12 Sep 2023 11:17:58 +0100 Subject: [PATCH 12/21] this way better --- gcp/cloud-run-v2/main.tf | 2 +- gcp/cloud-run-v2/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcp/cloud-run-v2/main.tf b/gcp/cloud-run-v2/main.tf index d9e6dda..b6efbff 100644 --- a/gcp/cloud-run-v2/main.tf +++ b/gcp/cloud-run-v2/main.tf @@ -1,5 +1,5 @@ locals { - cloud_armor_rules = fileexists(var.cloud_armor.rules_file_path) ? yamldecode(file(var.cloud_armor.rules_file_path)) : [] + cloud_armor_rules = var.cloud_armor.enabled ? yamldecode(file(var.cloud_armor.rules_file_path)) : [] } # Resource configuration for deploying a Google Cloud Run service diff --git a/gcp/cloud-run-v2/variables.tf b/gcp/cloud-run-v2/variables.tf index 3312c83..6958aa5 100644 --- a/gcp/cloud-run-v2/variables.tf +++ b/gcp/cloud-run-v2/variables.tf @@ -195,7 +195,7 @@ variable "cloud_armor" { }) default = { enabled = false - rules_file_path = "assets/cloud-armor-rules.yaml" + rules_file_path = "" } } From 50dae5168c7b7452269ae00d37c194ae2cb99e88 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:24:04 +0100 Subject: [PATCH 13/21] feat: Allow custom domains --- gcp/cloud-run-v2/main.tf | 2 +- gcp/cloud-run-v2/variables.tf | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcp/cloud-run-v2/main.tf b/gcp/cloud-run-v2/main.tf index 7351e0c..10a0c12 100644 --- a/gcp/cloud-run-v2/main.tf +++ b/gcp/cloud-run-v2/main.tf @@ -168,7 +168,7 @@ module "lb-http" { version = "~> 9.0" # SSL and domain configuration - managed_ssl_certificate_domains = [var.environment == "prod" ? "${var.name}.api.nandos.dev" : var.environment == "preview" ? "${var.name}-preview.api.nandos.dev" : "${var.name}-preprod.api.nandos.dev"] + managed_ssl_certificate_domains = [var.environment == "prod" ? "${var.name}.${var.domain_host}" : var.environment == "preview" ? "${var.name}-preview.${var.domain_host}" : "${var.name}-preprod.${var.domain_host}"] ssl = true https_redirect = true # Enable HTTPS redirect diff --git a/gcp/cloud-run-v2/variables.tf b/gcp/cloud-run-v2/variables.tf index 15d5845..9f61478 100644 --- a/gcp/cloud-run-v2/variables.tf +++ b/gcp/cloud-run-v2/variables.tf @@ -12,6 +12,13 @@ variable "name" { error_message = "The name can only contain alphanumeric characters, hyphens, and underscores." } } + +variable "domain_host" { + description = "The host name for the domain or subdomain where this service is exposed. If empty, the systems use api.nandos.dev. You can find available domains on https://github.com/NandosUK/infrastructure/blob/master/gcp/mgt-dns/environment/inputs-for-dns.auto.tfvars" + type = string + + default = "api.nandos.dev" +} variable "project_region" { description = "(Required) The location of the cloud run instance. eg europe-west2" type = string @@ -200,10 +207,10 @@ variable "cloud_armor" { } variable "eventarc_triggers" { - description = "Configuration for Eventarc triggers" + description = "Configuration for Eventarc triggers" type = list(object({ event_data_content_type = string - api_path = string + api_path = string matching_criteria = list(object({ attribute = string value = string From 7537089f700cd432805dea70a79fd643874369a2 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:26:59 +0100 Subject: [PATCH 14/21] Enforce commit messages --- .github/workflows/commit-message-check.yml | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/commit-message-check.yml diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml new file mode 100644 index 0000000..d0be774 --- /dev/null +++ b/.github/workflows/commit-message-check.yml @@ -0,0 +1,26 @@ +name: "Commit Message Check" + +on: + push: + branches: + - "**" + +jobs: + commit-message-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Check Commit Messages + run: | + commits=$(git log --format=%s origin/${{ github.base_ref }}..origin/${{ github.head_ref }}) + for commit in $commits + do + if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test):.* ]]; then + echo "Invalid commit message: $commit" + exit 1 + fi + done From fab10edf74e7c7c08bc56582d0bf5abb2f1c06a2 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:33:46 +0100 Subject: [PATCH 15/21] docs(main): update general docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2323a61..0785181 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ The commit message should be structured as follows: - `feat(api): add new validation logic` - `fix(cloud-run-v1): resolve issue with variable x` -- `chore(tests): add additional unit tests for utils` +- `test(utils): add additional unit tests for utils` - `docs(cloud-function-v1): update setup instructions` ### How to Make Commits From e3c84d2d51a28b3573c1ce779cbd4f35fb2a6ff0 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:35:18 +0100 Subject: [PATCH 16/21] docs(main): update general docs --- .github/workflows/commit-message-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index d0be774..a54b4e6 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -2,8 +2,8 @@ name: "Commit Message Check" on: push: - branches: - - "**" + branches: + - '**' jobs: commit-message-check: @@ -13,10 +13,10 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Check Commit Messages run: | - commits=$(git log --format=%s origin/${{ github.base_ref }}..origin/${{ github.head_ref }}) + commits=$(git log --format=%s ${{ github.event.before }}..${{ github.event.after }}) for commit in $commits do if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test):.* ]]; then From daf8122e2e03843875523f37be834ef1541bbbf8 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:36:40 +0100 Subject: [PATCH 17/21] docs(main): update general docs --- .github/workflows/commit-message-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index a54b4e6..ac64af7 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -19,7 +19,7 @@ jobs: commits=$(git log --format=%s ${{ github.event.before }}..${{ github.event.after }}) for commit in $commits do - if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test):.* ]]; then + if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test):\s+.* ]]; then echo "Invalid commit message: $commit" exit 1 fi From 8b134bf47a9635f7816ae077d35be6a7271459af Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:38:19 +0100 Subject: [PATCH 18/21] docs(main): update general docs --- .github/workflows/commit-message-check.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index ac64af7..e11073e 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -2,8 +2,8 @@ name: "Commit Message Check" on: push: - branches: - - '**' + branches: + - "**" jobs: commit-message-check: @@ -13,11 +13,12 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Check Commit Messages run: | - commits=$(git log --format=%s ${{ github.event.before }}..${{ github.event.after }}) - for commit in $commits + + IFS=$'\n' commits=($(git log --format=%s ${{ github.event.before }}..${{ github.event.after }})) + for commit in "${commits[@]}" do if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test):\s+.* ]]; then echo "Invalid commit message: $commit" From 8a53e048ee5bcd5c6b8b17be3473f595cb1ef29e Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:57:59 +0100 Subject: [PATCH 19/21] fix(general): test message --- .github/workflows/commit-message-check.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index e11073e..4a4fc2b 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -16,11 +16,10 @@ jobs: - name: Check Commit Messages run: | - - IFS=$'\n' commits=($(git log --format=%s ${{ github.event.before }}..${{ github.event.after }})) - for commit in "${commits[@]}" + commits=$(git log --format=%s origin/${{ github.base_ref }}..origin/${{ github.head_ref }}) + for commit in $commits do - if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test):\s+.* ]]; then + if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?:?.{2,} ]]; then echo "Invalid commit message: $commit" exit 1 fi From e0fea861cc595bfc90357c44ab7853fb38087d84 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 15:59:18 +0100 Subject: [PATCH 20/21] fix(general): test message --- .github/workflows/commit-message-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index 4a4fc2b..8f5cc57 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -16,7 +16,7 @@ jobs: - name: Check Commit Messages run: | - commits=$(git log --format=%s origin/${{ github.base_ref }}..origin/${{ github.head_ref }}) + commits=$(git log --format=%s ${{ github.event.before }}..${{ github.event.after }}) for commit in $commits do if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?:?.{2,} ]]; then From 54114530c95e9e484d9a6e817812f9bc53270db5 Mon Sep 17 00:00:00 2001 From: miguelpuiggarcia Date: Tue, 12 Sep 2023 16:01:27 +0100 Subject: [PATCH 21/21] fix(general): test message --- .github/workflows/commit-message-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-message-check.yml b/.github/workflows/commit-message-check.yml index 8f5cc57..26d6d16 100644 --- a/.github/workflows/commit-message-check.yml +++ b/.github/workflows/commit-message-check.yml @@ -16,8 +16,8 @@ jobs: - name: Check Commit Messages run: | - commits=$(git log --format=%s ${{ github.event.before }}..${{ github.event.after }}) - for commit in $commits + IFS=$'\n' commits=($(git log --format=%s ${{ github.event.before }}..${{ github.event.after }})) + for commit in "${commits[@]}" do if ! [[ "$commit" =~ ^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?:?.{2,} ]]; then echo "Invalid commit message: $commit"