Skip to content

Commit

Permalink
Fix CI links for unsafe branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
steve9164 committed Oct 16, 2023
1 parent 76b2a0b commit c5fd9b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildprocess/ci-cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function createIngress(branches) {
host: "ci.terria.io",
http: {
paths: branches.map((branch) => ({
path: "/" + branch.name + "(/|$)(.*)",
path: "/" + makeSafeName(branch.name) + "(/|$)(.*)",
pathType: "ImplementationSpecific",
backend: {
service: {
Expand Down
2 changes: 2 additions & 0 deletions buildprocess/ci-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ fi
# A version of the branch name that can be used as a DNS name once we prepend and append some stuff.
SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g' -e 's/-*$//')

[[ $SAFE_BRANCH_NAME != $GITHUB_BRANCH ]] && echo "::warning file=buildprocess/ci-deploy.sh::Branch name sanitised to '${SAFE_BRANCH_NAME}' for kubernetes resources. This may work, however using branch names less than 32 characters long with [a-z0-9] and hyphen separators are preferred"

gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}

# Install some tools we need from npm
Expand Down

0 comments on commit c5fd9b7

Please sign in to comment.