Skip to content

Commit 8d194fa

Browse files
committed
Restrict custom dashboard builds to master branch PRs only
Add base branch check to ensure custom dashboard builds only run for PRs targeting master. For PRs targeting release branches or other branches, always use gromit default. This prevents unnecessary custom builds and ensures release branches follow their normal workflow. Related: TT-15971
1 parent e0a882a commit 8d194fa

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,17 +435,26 @@ jobs:
435435
echo "📊 Dashboard Image Resolution"
436436
echo "=================================="
437437
echo "PR number: $PR_NUMBER"
438+
echo "Base ref: $BASE_REF"
438439
echo "Branch exists: $BRANCH_EXISTS"
439440
echo "PR image exists: $IMAGE_EXISTS"
440441
echo "Branch name: $BRANCH"
441442
echo "PR image tag: $IMAGE_TAG"
442-
echo "Base ref: $BASE_REF"
443443
echo "Commit SHA: $COMMIT_SHA"
444444
echo "Has relevant changes in latest commit: $HAS_RELEVANT_CHANGES"
445445
echo "=================================="
446446
447+
# Only use custom build strategies for PRs targeting master
448+
if [ "$BASE_REF" != "master" ]; then
449+
echo "ℹ️ Strategy: Use gromit default (base branch is not master)"
450+
echo " → Custom builds only for master branch PRs"
451+
echo "dashboard_image=" >> $GITHUB_OUTPUT
452+
echo "needs_build=false" >> $GITHUB_OUTPUT
453+
echo "dashboard_branch=" >> $GITHUB_OUTPUT
454+
echo "strategy=gromit-default" >> $GITHUB_OUTPUT
455+
447456
# Strategy 1: Matching branch exists in tyk-analytics → use gromit
448-
if [ "$BRANCH_EXISTS" = "true" ]; then
457+
elif [ "$BRANCH_EXISTS" = "true" ]; then
449458
echo "📋 Strategy: Use matching branch '$BRANCH' via gromit"
450459
echo " → No override needed, gromit will handle it"
451460
echo "dashboard_image=" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)