Skip to content

Commit c0265be

Browse files
committed
Check before adding MS repo
1 parent f8e568e commit c0265be

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ jobs:
212212
213213
- name: Create domainadmin as SQL sysadmin
214214
run: |
215-
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list | \
216-
sudo tee /etc/apt/sources.list.d/mssql-release.list
215+
if ! grep -Rqs "https://packages.microsoft.com/ubuntu/22.04/prod" /etc/apt/sources.list /etc/apt/sources.list.d; then
216+
echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" | \
217+
sudo tee /etc/apt/sources.list.d/microsoft-prod.list > /dev/null
218+
fi
217219
sudo apt-get update
218220
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
219221
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'P@ssw0rd' -C -Q "

0 commit comments

Comments
 (0)