Skip to content

Commit 9e689ef

Browse files
committed
Move test db pwds to external file/secret
1 parent 994bb63 commit 9e689ef

5 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/api-build-and-test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: API Build & Test
22

33
on:
44
workflow_call:
5+
secrets:
6+
MSSQL_SA_PASSWORD:
7+
required: true
58

69
jobs:
710
build-and-test:
@@ -12,11 +15,11 @@ jobs:
1215
image: mcr.microsoft.com/mssql/server:2025-latest
1316
env:
1417
ACCEPT_EULA: Y
15-
MSSQL_SA_PASSWORD: 2#r4U@8GO1Kv@xNFi3k
18+
MSSQL_SA_PASSWORD: ${{ secrets.MSSQL_SA_PASSWORD }}
1619
ports:
1720
- 1433:1433
1821
options: >-
19-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '2#r4U@8GO1Kv@xNFi3k' -C -Q 'SELECT 1' || exit 1"
22+
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '${{ secrets.MSSQL_SA_PASSWORD }}' -C -Q 'SELECT 1' || exit 1"
2023
--health-interval 10s
2124
--health-timeout 5s
2225
--health-retries 5
@@ -39,7 +42,7 @@ jobs:
3942
- name: Test
4043
run: dotnet test ProcureHub.sln --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=ProcureHubTests.trx" --results-directory ./TestResults
4144
env:
42-
ConnectionStrings__DefaultConnection: "Server=localhost;Database=procurehub_tests;User Id=sa;Password=2#r4U@8GO1Kv@xNFi3k;TrustServerCertificate=true"
45+
ConnectionStrings__DefaultConnection: "Server=localhost;Database=procurehub_tests;User Id=sa;Password=${{ secrets.MSSQL_SA_PASSWORD }};TrustServerCertificate=true"
4346

4447
- name: Test Report
4548
uses: dorny/test-reporter@v2

.github/workflows/api-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ on:
2222
jobs:
2323
build-and-test:
2424
uses: ./.github/workflows/api-build-and-test.yml
25+
secrets: inherit
2526

.github/workflows/api-deploy-staging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ permissions:
2626
jobs:
2727
build-and-test:
2828
uses: ./.github/workflows/api-build-and-test.yml
29+
secrets: inherit
2930

3031
push-image:
3132
needs: build-and-test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ todos.md
1313
.notes/
1414
.context/ignore
1515
.bruno/
16+
.env
1617
Prototype/
1718

1819
# Terraform

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
- "1433:1433"
77
environment:
88
ACCEPT_EULA: Y
9-
MSSQL_SA_PASSWORD: 2#r4U@8GO1Kv@xNFi3k
9+
MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD}
1010
volumes:
1111
- sqldata:/var/opt/mssql
1212
restart: unless-stopped

0 commit comments

Comments
 (0)