Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Loading