File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 5454 BRANCH : " ${{ env.GITHUB_BRANCH_NAME }}"
5555 run : make preview
5656
57+ - name : Get safe branch and export to env
58+ env :
59+ BRANCH : ${{ env.GITHUB_BRANCH_NAME }}
60+ run : |
61+ echo "SAFE_BRANCH=$(make safe_branch)" >> $GITHUB_ENV
62+
5763 - name : Update PR Comment
5864 uses : actions/github-script@v7
5965 if : github.event_name == 'pull_request'
8086 }
8187 });
8288
83- const branch_name = process.env.GITHUB_BRANCH_NAME ;
84- const url = "https://" + branch_name + "." + process.env.PREVIEW_HOSTNAME;
89+ const safe_branch = process.env.SAFE_BRANCH ;
90+ const url = "https://" + safe_branch + "." + process.env.PREVIEW_HOSTNAME;
8591 const timestamp = new Date().toISOString();
8692 const header = "\n|Key|Value|\n|---|---|\n"
8793 const body = preview_identifier + header + "|url|" + url + "|\n|last update|" + timestamp + "|";
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export GIT_VERSION ?= $(shell git rev-parse --short HEAD)
1818# Auto-detect and sanitize current git branch
1919BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
2020# Replace "/" and other non-alphanumeric characters with "-"
21- SAFE_BRANCH := $(shell echo "$(BRANCH ) " | sed 's/[^A-Za -z0-9-]/-/g')
21+ SAFE_BRANCH := $(shell echo "$(BRANCH ) " | tr '[:upper:]' '[:lower:]' | sed 's/[^a -z0-9-]/-/g')
2222FORCE_DEPLOY ?= false
2323SITE_URL ?= "https://$(SAFE_BRANCH ) .ep-preview.click"
2424
You can’t perform that action at this time.
0 commit comments