Skip to content

Commit 837569c

Browse files
authored
feat: fix vuln branch setting (#32039)
1 parent 2de9eb8 commit 837569c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/workflows/gif_check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
# Branch Name Validation to be run prior to workflow
2828
- name: Validate branch name and set output
2929
id: validate
30+
env:
31+
BRANCH: ${{ github.head_ref }}
3032
run: |
31-
BRANCH="${{ github.head_ref }}"
33+
BRANCH="${{ env.BRANCH }}"
3234
# Allow: letters, numbers, dots, hyphens, underscores, and forward slash
3335
# This supports the required <name>/<description> format like "user.name/test-this-new-feature"
3436
if [[ "$BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]] && [[ ${#BRANCH} -le 200 ]]; then

.github/workflows/preview_link.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ jobs:
3333
# Branch Name Validation to be run prior to workflow
3434
- name: Validate branch name and set output
3535
id: validate
36+
env:
37+
BRANCH: ${{ github.head_ref }}
3638
run: |
37-
BRANCH="${{ github.head_ref }}"
39+
BRANCH="${{ env.BRANCH }}"
3840
# Allow: letters, numbers, dots, hyphens, underscores, and forward slash
3941
# This supports the required <name>/<description> format like "user.name/test-this-new-feature"
4042
if [[ "$BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]] && [[ ${#BRANCH} -le 200 ]] && [[ "$BRANCH" == *"/"* ]]; then

.github/workflows/synthetics.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
# Branch Name Validation to be run prior to workflow
2828
- name: Validate branch name and set output
2929
id: validate
30+
env:
31+
BRANCH: ${{ github.event.pull_request.head.ref }}
3032
run: |
31-
BRANCH="${{ github.event.pull_request.head.ref }}"
33+
BRANCH="${{ env.BRANCH }}"
3234
# Allow: letters, numbers, dots, hyphens, underscores, and forward slash
3335
# This supports the required <name>/<description> format like "user.name/test-this-new-feature"
3436
if [[ "$BRANCH" =~ ^[a-zA-Z0-9._/-]+$ ]] && [[ ${#BRANCH} -le 200 ]]; then
@@ -42,9 +44,11 @@ jobs:
4244
- name: Check preview status
4345
id: check-status
4446
if: steps.validate.outputs.valid == 'true'
47+
env:
48+
BRANCH: ${{ steps.validate.outputs.branch }}
4549
run: |
4650
# Use the validated branch name from previous step
47-
BRANCH="${{ steps.validate.outputs.branch }}"
51+
BRANCH="${{ env.BRANCH }}"
4852
URL="https://docs-staging.datadoghq.com/${BRANCH}"
4953
SUCCESS_CODES=("200" "302" "304")
5054
for i in {1..30}

0 commit comments

Comments
 (0)