From 39479c184e1fb4b99b1062069d5b1c4c08c08adc Mon Sep 17 00:00:00 2001 From: ayush Date: Tue, 17 Mar 2026 04:34:00 +0530 Subject: [PATCH] fix: updated pr-checks and tf-checks workflow --- .github/workflows/pr-checks.yml | 10 ++++------ .github/workflows/tf-checks.yml | 14 +++----------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index a1fae02d..10ba99e0 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -57,13 +57,11 @@ jobs: TITLE="${{ github.event.pull_request.title }}" echo "PR Title: $TITLE" - TYPES=$(echo "${{ inputs.types }}" | tr '\n' '|' | sed 's/|$//') - - # Allow capitalized types as well - TYPES_REGEX="${TYPES}|$(echo ${TYPES} | sed 's/\([^|]*\)/\u\1|\l\1/g')" + shopt -s nocasematch + TYPES=$(echo "${{ inputs.types }}" | tr ',\n' '|' | sed 's/|$//') # Full regex for conventional commits - FULL_REGEX="^(${TYPES_REGEX})(\([a-zA-Z0-9_-]+\))?:\s+${{ inputs.subjectPattern }}$" + FULL_REGEX="^(${TYPES})(\([a-zA-Z0-9_-]+\))?:\s+${{ inputs.subjectPattern }}$" if [[ ! "$TITLE" =~ $FULL_REGEX ]]; then echo "::error::PR title does not follow Conventional Commit format." @@ -84,7 +82,7 @@ jobs: # Enforce scope if required if [[ "${{ inputs.requireScope }}" == "true" ]]; then - if [[ ! "$TITLE" =~ ^(${TYPES_REGEX})\([a-zA-Z0-9_-]+\): ]]; then + if [[ ! "$TITLE" =~ ^(${TYPES})\([a-zA-Z0-9_-]+\): ]]; then echo "::error::PR title must include a scope because requireScope=true" echo "Example:" echo " feat(auth): Add login API" diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index e3ce44da..473e173e 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -259,23 +259,15 @@ jobs: - name: ๐Ÿงน Terraform Format uses: 'dflook/terraform-fmt-check@v2' - with: - actions_subcommand: 'fmt' - name: ๐Ÿ—๏ธ Terraform Init - uses: hashicorp/terraform-github-actions@master - with: - tf_actions_subcommand: "init" - tf_actions_version: 1.3.6 - tf_actions_working_dir: ${{ inputs.working_directory }} - env: - GITHUB_TOKEN: '${{ secrets.GITHUB }}' - TF_CLI_ARGS: "-backend-config=token=${{ secrets.TF_API_TOKEN }}" + id: init + run: terraform init -input=false - name: ๐Ÿ”Ž Terraform validate uses: dflook/terraform-validate@v2 with: - tf_actions_working_dir: ${{ inputs.working_directory }} + path: ${{ inputs.working_directory }} - name: ๐Ÿ“‹ Terraform Plan if: ${{ inputs.enable_plan }}