Skip to content

Commit 9f2c914

Browse files
added sanitized and unique postgres hostname
1 parent 11c909a commit 9f2c914

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/build-node-python.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,20 @@ env:
8080
PYPI_USERNAME: "datavisyn"
8181
PYTHON_VERSION: "3.10"
8282
WORKFLOW_BRANCH: "new_deployment_no_ports"
83-
POSTGRES_HOSTNAME: postgres_${{ inputs.branch }}_${{ github.run_id }}
83+
POSTGRES_HOSTNAME: postgres_${{ env.BRANCH_SAFE }}_${{ github.run_id }}
8484

8585
permissions:
8686
contents: read
8787
id-token: write
8888

8989
jobs:
90+
setup:
91+
runs-on: ${{ inputs.runs_on }}
92+
steps:
93+
- name: Generate safe branch name for unique hostname
94+
run: echo "BRANCH_SAFE=$(echo ${{ inputs.branch }} | sed 's/[^a-zA-Z0-9]/-/g' | head -c 20)" >> "$GITHUB_ENV"
95+
- name: Set POSTGRES_HOSTNAME
96+
run: echo "POSTGRES_HOSTNAME=postgres_${{ env.BRANCH_SAFE }}_${{ github.run_id }}" >> "$GITHUB_ENV"
9097
build-node:
9198
name: Node
9299
if: ${{ (!inputs.cypress_enable || (!inputs.cypress_run_because_flag && inputs.cypress_run_because_branch != 'true')) && (!inputs.playwright_enable || (!inputs.playwright_run_because_flag && inputs.playwright_run_because_branch != 'true')) }}
@@ -167,8 +174,8 @@ jobs:
167174
--health-interval 10s
168175
--health-timeout 5s
169176
--health-retries 5
170-
--name postgres_${{ inputs.branch }}_${{ github.run_id }}
171-
177+
--name postgres_${{ env.BRANCH_SAFE }}_${{ github.run_id }}
178+
172179
steps:
173180
- name: Set system env variable to github env
174181
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
@@ -271,7 +278,7 @@ jobs:
271278
--health-interval 10s
272279
--health-timeout 5s
273280
--health-retries 5
274-
--name postgres_${{ inputs.branch }}_${{ github.run_id }}
281+
--name postgres_${{ env.BRANCH_SAFE }}_${{ github.run_id }}
275282
276283
steps:
277284
- name: Set system env variable to github env

0 commit comments

Comments
 (0)