From a7a97d0acdd448ee29a57905da228999b6951600 Mon Sep 17 00:00:00 2001 From: Devin Ford Date: Tue, 7 Oct 2025 14:37:31 -0400 Subject: [PATCH] feat: fix vuln branch setting --- .github/workflows/gif_check.yml | 4 +++- .github/workflows/preview_link.yml | 4 +++- .github/workflows/synthetics.yml | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gif_check.yml b/.github/workflows/gif_check.yml index 0d6e507d77dc2..7ba2227bff502 100644 --- a/.github/workflows/gif_check.yml +++ b/.github/workflows/gif_check.yml @@ -27,8 +27,10 @@ jobs: # Branch Name Validation to be run prior to workflow - name: Validate branch name and set output id: validate + env: + BRANCH: ${{ github.head_ref }} run: | - BRANCH="${{ github.head_ref }}" + BRANCH="${{ env.BRANCH }}" # Allow: letters, numbers, dots, hyphens, underscores, and forward slash # This supports the required / format like "user.name/test-this-new-feature" if [[ "$BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]] && [[ ${#BRANCH} -le 200 ]]; then diff --git a/.github/workflows/preview_link.yml b/.github/workflows/preview_link.yml index b032bad7ef9d8..e1351b4009977 100644 --- a/.github/workflows/preview_link.yml +++ b/.github/workflows/preview_link.yml @@ -33,8 +33,10 @@ jobs: # Branch Name Validation to be run prior to workflow - name: Validate branch name and set output id: validate + env: + BRANCH: ${{ github.head_ref }} run: | - BRANCH="${{ github.head_ref }}" + BRANCH="${{ env.BRANCH }}" # Allow: letters, numbers, dots, hyphens, underscores, and forward slash # This supports the required / format like "user.name/test-this-new-feature" if [[ "$BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]] && [[ ${#BRANCH} -le 200 ]] && [[ "$BRANCH" == *"/"* ]]; then diff --git a/.github/workflows/synthetics.yml b/.github/workflows/synthetics.yml index 609051cf90b8b..4c803ad90640d 100644 --- a/.github/workflows/synthetics.yml +++ b/.github/workflows/synthetics.yml @@ -27,8 +27,10 @@ jobs: # Branch Name Validation to be run prior to workflow - name: Validate branch name and set output id: validate + env: + BRANCH: ${{ github.event.pull_request.head.ref }} run: | - BRANCH="${{ github.event.pull_request.head.ref }}" + BRANCH="${{ env.BRANCH }}" # Allow: letters, numbers, dots, hyphens, underscores, and forward slash # This supports the required / format like "user.name/test-this-new-feature" if [[ "$BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]] && [[ ${#BRANCH} -le 200 ]]; then @@ -42,9 +44,11 @@ jobs: - name: Check preview status id: check-status if: steps.validate.outputs.valid == 'true' + env: + BRANCH: ${{ steps.validate.outputs.branch }} run: | # Use the validated branch name from previous step - BRANCH="${{ steps.validate.outputs.branch }}" + BRANCH="${{ env.BRANCH }}" URL="https://docs-staging.datadoghq.com/${BRANCH}" SUCCESS_CODES=("200" "302" "304") for i in {1..30}