Skip to content

Update KinsonDigital/Infrastructure action to v14 #186

Update KinsonDigital/Infrastructure action to v14

Update KinsonDigital/Infrastructure action to v14 #186

name: ✅Branch Status Check
defaults:
run:
shell: pwsh
on:
workflow_dispatch:
pull_request:
branches: main
jobs:
branch_status_check:
name: PR Branch Status Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: ${{ vars.DENO_VERSION }}
- name: Validate Branch
run: |
$targetBranch = "${{ github.base_ref }}";
$srcBranch = "${{ github.head_ref }}";
# Validate the source branch
if ($srcBranch -notmatch "${{ vars.FEATURE_BRANCH_REGEX }}" -and $srcBranch -notmatch "${{ vars.RENOVATE_BRANCH_REGEX }}") {
$errorMsg = "::error::The source branch name '$srcBranch' is invalid.";
$errorMsg += "`nIt must match the regex '${{ vars.FEATURE_BRANCH_REGEX }}' or '${{ vars.RENOVATE_BRANCH_REGEX }}'";
Write-Host $errorMsg;
exit 1;
}
# Validate the target branch
if ($targetBranch -ne "main") {
Write-Host "::error::The target branch must be 'main'";
exit 1;
}