Skip to content

Commit

Permalink
Good Microsoft documents the same process in many different places
Browse files Browse the repository at this point in the history
  • Loading branch information
BenedekFarkas committed Oct 20, 2024
1 parent e154496 commit 80e5059
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/actions/install-sqlcmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ runs:
run: |
Set-GitHubOutput 'available' ($null -ne (Get-Command sqlcmd -ErrorAction SilentlyContinue))
# Source: https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility?view=sql-server-ver16&tabs=go%2Clinux&pivots=cs1-bash#download-and-install-sqlcmd
# Source: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?tabs=ubuntu18-install#18
- name: Install sqlcmd on Linux
if: runner.os == 'Linux' && steps.check-sqlcmd.outputs.available != 'true'
shell: bash
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/22.04/prod.list)" -y
curl https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo apt-get install sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
- name: Display sqlcmd version
shell: pwsh
Expand Down

0 comments on commit 80e5059

Please sign in to comment.