From a94c5d2e691f68566971e25ad410c59737d81127 Mon Sep 17 00:00:00 2001 From: aaron burtle Date: Thu, 27 Jun 2024 13:55:45 -0700 Subject: [PATCH] add users and logins and env vars for them --- .github/workflows/SQL2019.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/SQL2019.yaml b/.github/workflows/SQL2019.yaml index e0454af..d6845b9 100644 --- a/.github/workflows/SQL2019.yaml +++ b/.github/workflows/SQL2019.yaml @@ -127,6 +127,26 @@ jobs: - name: Restore AirlineTestDB run: sqlcmd -S localhost -U SA -P %dbPassword% -l 5 -Q "USE [master]; RESTORE DATABASE [AirlineTestDB] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup\AirlineTestDB.bak' WITH FILE = 1, MOVE N'AirlineTestDB' TO N'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\AirlineTestDB_Primary.mdf', MOVE N'AirlineTestDB_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\AirlineTestDB_Primary.ldf', NOUNLOAD, STATS = 5;" + - name: Create Logins for Test DBs + run: sqlcmd -S localhost -U SA -P %dbPassword% -l 5 -Q " + CREATE LOGIN AirlineUser WITH PASSWORD = '%dbPassword%', CHECK_POLICY=OFF, CHECK_EXPIRATION = OFF, DEFAULT_DATABASE=AirlineTestDB; + CREATE LOGIN AirlineUserdbowner WITH PASSWORD = '%dbPassword%', CHECK_POLICY=OFF, CHECK_EXPIRATION = OFF, DEFAULT_DATABASE=AirlineTestDB;" + + - name: Alter AirlineUser + run: sqlcmd -S localhost -U SA -P %dbPassword% -l 5 -Q " + USE AirlineTestDB; + ALTER USER [AirlineUser] WITH LOGIN=[AirlineUser]" + + - name: Alter AirlineUserdbowner + run: sqlcmd -S localhost -U SA -P %dbPassword% -l 5 -Q " + USE AirlineTestDB; + ALTER USER [AirlineUserdbowner] WITH LOGIN=[AirlineUserdbowner]" + + - name: Alter Authorization + run: sqlcmd -S localhost -U SA -P %dbPassword% -l 5 -Q " + USE AirlineTestDB; + ALTER AUTHORIZATION ON SCHEMA::[db_owner] TO [AirlineUserdbowner]" + - name: Set up R ${{ env.r-version }} Runtime uses: r-lib/actions/setup-r@v2 with: @@ -149,6 +169,9 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: working-directory: ./R + env: + PASSWORD_AIRLINE_USER: "${{ env.dbPassword }}" + PASSWORD_AIRLINE_USER_DBOWNER: "${{ env.dbPassword }}" continue-on-error: true