Skip to content

Use workload identity for sql server auth #25

Use workload identity for sql server auth

Use workload identity for sql server auth #25

Workflow file for this run

name: Pull request
on:
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build docker image
env:
REF: ${{ github. sha }}
run: make build
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install dependencies
run: go mod download
- name: Install GolangCI Lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
- name: golangci-lint
run: golangci-lint run --timeout=30m --max-same-issues=0 --out-format=github-actions
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install dependencies
run: go mod download
- name: Run Tests
run: go test -cover `go list ./... | grep -v 'pkg/client'`
test-sql-workflow:
name: Test SQL
runs-on: ubuntu-latest
env:
connection: >-
Server=sql-radix-vulnerability-scan-dev.database.windows.net;
Initial Catalog=radix-vulnerability-scan;
Authentication=Active Directory Default;
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=30;
steps:
- uses: actions/checkout@v4
- uses: azure/login@v1
with:
client-id: "9e11916f-356b-4fb1-94ae-f06cc8e473b8"
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
# subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b"
allow-no-subscriptions: true
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/predeploy.sql'
# - uses: azure/sql-action@v2.2.1
# with:
# connetion-string: ${{env.connection}}
# path: ./azure-infrastructure/sql-scripts/roles.sql
# - uses: azure/sql-action@v2.2.1
# with:
# connetion-string: ${{env.connection}}
# path: ./azure-infrastructure/sql-scripts/types.sql
# - uses: azure/sql-action@v2.2.1
# with:
# connetion-string: ${{env.connection}}
# path: ./azure-infrastructure/sql-scripts/tables.sql
# - uses: azure/sql-action@v2.2.1
# with:
# connetion-string: ${{env.connection}}
# path: ./azure-infrastructure/sql-scripts/views.sql
# - uses: azure/sql-action@v2.2.1
# with:
# connetion-string: ${{env.connection}}
# path: ./azure-infrastructure/sql-scripts/procedures.sql