diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 3ebceab..76896c6 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -18,16 +18,18 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Verify PR Title - # Pass untrusted values (the PR title) via the environment rather than - # direct ${{ }} interpolation, so they are treated as data and cannot - # inject shell commands. + # Pass untrusted values (the PR title and branch refs) via the + # environment rather than direct ${{ }} interpolation, so they are + # treated as data and cannot inject shell commands. env: PR_TITLE: ${{ github.event.pull_request.title }} BASE_REF: ${{ github.base_ref }} + HEAD_REF: ${{ github.head_ref }} run: | title="$PR_TITLE" title_upper=$(echo "$title" | tr '[:lower:]' '[:upper:]') base_ref="$BASE_REF" + head_ref="$HEAD_REF" # Define regex patterns for different types of PR titles MAIN2DEV_REGEX="^MAIN2DEV[[:space:]]*:?[[:space:]]*@W-[[:digit:]]{8,9}@.*MERGING.+[[:digit:]]{1,2}\.[[:digit:]]{1,2}\.[[:digit:]]{1,2}.*" @@ -35,7 +37,7 @@ jobs: PR_INTO_DEV_OR_RELEASE_REGEX="^(FIX|CHANGE|NEW)([[:space:]]*\([^)]+\))?[[:space:]]*:?[[:space:]]*@W-[[:digit:]]{8,9}@.+" # Validate PR title based on base_ref and head_ref - if [[ "$base_ref" == "dev" && "${{ startsWith(github.head_ref, 'm2d/') }}" == "true" ]]; then + if [[ "$base_ref" == "dev" && "$head_ref" == m2d/* ]]; then if [[ ! "$title_upper" =~ $MAIN2DEV_REGEX ]]; then echo "::error::Invalid PR title: '$title'. Please follow the format: Main2Dev (__) @W-XXXXXXXX@ Merging.*\d+\.\d+\.\d+" exit 1 @@ -45,7 +47,7 @@ jobs: echo "::error::Invalid PR title: '$title'. Please follow the format: RELEASE @W-XXXXXXXX@ Summary" exit 1 fi - elif [[ "$base_ref" == "dev" || "${{ startsWith(github.base_ref, 'release-') }}" == "true" ]]; then + elif [[ "$base_ref" == "dev" || "$base_ref" == release-* ]]; then if [[ ! "$title_upper" =~ $PR_INTO_DEV_OR_RELEASE_REGEX ]]; then echo "::error::Invalid PR title: '$title'. Please follow the format: FIX|CHANGE|NEW (__) @W-XXXXXXXX@ Summary" exit 1 diff --git a/SHA256.md b/SHA256.md index d707427..e09b026 100644 --- a/SHA256.md +++ b/SHA256.md @@ -15,7 +15,7 @@ make sure that their SHA values match the values in the list below. shasum -a 256 3. Confirm that the SHA in your output matches the value in this list of SHAs. - c31411aa07d8e11d0bbbba6bc036f46f1512424271e8baaf6b07e96f129be363 ./extensions/sfdx-code-analyzer-vscode-1.21.0.vsix + ac4707b344d17ecd4c7729bff6701d0a40cca61964d2efa70fd69fba747cb8de ./extensions/sfdx-code-analyzer-vscode-1.22.0.vsix 4. Change the filename extension for the file that you downloaded from .zip to .vsix. diff --git a/package-lock.json b/package-lock.json index 420c8cf..b484e1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sfdx-code-analyzer-vscode", - "version": "1.21.0", + "version": "1.22.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sfdx-code-analyzer-vscode", - "version": "1.21.0", + "version": "1.22.0", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { diff --git a/package.json b/package.json index bd8181d..f60c2fa 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "color": "#ECECEC", "theme": "light" }, - "version": "1.21.0", + "version": "1.22.0", "publisher": "salesforce", "license": "BSD-3-Clause", "engines": {