Skip to content

Commit acffa6c

Browse files
authored
fix: updated pr-checks and tf-checks workflow (#344)
1 parent d27d2d3 commit acffa6c

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

.github/workflows/pr-checks.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,11 @@ jobs:
5757
TITLE="${{ github.event.pull_request.title }}"
5858
echo "PR Title: $TITLE"
5959
60-
TYPES=$(echo "${{ inputs.types }}" | tr '\n' '|' | sed 's/|$//')
61-
62-
# Allow capitalized types as well
63-
TYPES_REGEX="${TYPES}|$(echo ${TYPES} | sed 's/\([^|]*\)/\u\1|\l\1/g')"
60+
shopt -s nocasematch
61+
TYPES=$(echo "${{ inputs.types }}" | tr ',\n' '|' | sed 's/|$//')
6462
6563
# Full regex for conventional commits
66-
FULL_REGEX="^(${TYPES_REGEX})(\([a-zA-Z0-9_-]+\))?:\s+${{ inputs.subjectPattern }}$"
64+
FULL_REGEX="^(${TYPES})(\([a-zA-Z0-9_-]+\))?:\s+${{ inputs.subjectPattern }}$"
6765
6866
if [[ ! "$TITLE" =~ $FULL_REGEX ]]; then
6967
echo "::error::PR title does not follow Conventional Commit format."
@@ -84,7 +82,7 @@ jobs:
8482
8583
# Enforce scope if required
8684
if [[ "${{ inputs.requireScope }}" == "true" ]]; then
87-
if [[ ! "$TITLE" =~ ^(${TYPES_REGEX})\([a-zA-Z0-9_-]+\): ]]; then
85+
if [[ ! "$TITLE" =~ ^(${TYPES})\([a-zA-Z0-9_-]+\): ]]; then
8886
echo "::error::PR title must include a scope because requireScope=true"
8987
echo "Example:"
9088
echo " feat(auth): Add login API"

.github/workflows/tf-checks.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,23 +259,15 @@ jobs:
259259

260260
- name: 🧹 Terraform Format
261261
uses: 'dflook/terraform-fmt-check@v2'
262-
with:
263-
actions_subcommand: 'fmt'
264262

265263
- name: 🏗️ Terraform Init
266-
uses: hashicorp/terraform-github-actions@master
267-
with:
268-
tf_actions_subcommand: "init"
269-
tf_actions_version: 1.3.6
270-
tf_actions_working_dir: ${{ inputs.working_directory }}
271-
env:
272-
GITHUB_TOKEN: '${{ secrets.GITHUB }}'
273-
TF_CLI_ARGS: "-backend-config=token=${{ secrets.TF_API_TOKEN }}"
264+
id: init
265+
run: terraform init -input=false
274266

275267
- name: 🔎 Terraform validate
276268
uses: dflook/terraform-validate@v2
277269
with:
278-
tf_actions_working_dir: ${{ inputs.working_directory }}
270+
path: ${{ inputs.working_directory }}
279271

280272
- name: 📋 Terraform Plan
281273
if: ${{ inputs.enable_plan }}

0 commit comments

Comments
 (0)