From 15c2f65f6a35279d223574aeb7c96040d05ca1d4 Mon Sep 17 00:00:00 2001 From: Ege Akman Date: Tue, 27 May 2025 19:06:12 -0400 Subject: [PATCH 1/3] Update preview.yml --- .github/workflows/preview.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b0fd68b1e..faca8bbf2 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -54,6 +54,10 @@ jobs: BRANCH: "${{ env.GITHUB_BRANCH_NAME }}" run: make preview + - name: Get safe branch and export to env + run: | + echo "SAFE_BRANCH=$(make safe_branch)" >> $GITHUB_ENV + - name: Update PR Comment uses: actions/github-script@v7 if: github.event_name == 'pull_request' @@ -80,8 +84,8 @@ jobs: } }); - const branch_name = process.env.GITHUB_BRANCH_NAME; - const url = "https://" + branch_name + "." + process.env.PREVIEW_HOSTNAME; + const safe_branch = process.env.SAFE_BRANCH; + const url = "https://" + safe_branch + "." + process.env.PREVIEW_HOSTNAME; const timestamp = new Date().toISOString(); const header = "\n|Key|Value|\n|---|---|\n" const body = preview_identifier + header + "|url|" + url + "|\n|last update|" + timestamp + "|"; From 0f6e53597b946db9da87ca2c80b1f485c2af9970 Mon Sep 17 00:00:00 2001 From: egeakman Date: Tue, 27 May 2025 19:13:43 -0400 Subject: [PATCH 2/3] a --- .github/workflows/preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index faca8bbf2..98306415c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -55,6 +55,8 @@ jobs: run: make preview - name: Get safe branch and export to env + env: + BRANCH: ${{ env.GITHUB_BRANCH_NAME }} run: | echo "SAFE_BRANCH=$(make safe_branch)" >> $GITHUB_ENV From 117db4796869a48eacdff3c1b5b8dccef3e81a47 Mon Sep 17 00:00:00 2001 From: Niko Date: Wed, 28 May 2025 12:06:32 +0200 Subject: [PATCH 3/3] Update safe branch --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 37b1b7c9a..2d16e8e8f 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ export GIT_VERSION ?= $(shell git rev-parse --short HEAD) # Auto-detect and sanitize current git branch BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) # Replace "/" and other non-alphanumeric characters with "-" -SAFE_BRANCH := $(shell echo "$(BRANCH)" | sed 's/[^A-Za-z0-9-]/-/g') +SAFE_BRANCH := $(shell echo "$(BRANCH)" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g') FORCE_DEPLOY ?= false SITE_URL ?= "https://$(SAFE_BRANCH).ep-preview.click"