Skip to content

Use workload identity for sql server auth #36

Use workload identity for sql server auth

Use workload identity for sql server auth #36

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
matrix:

Check failure on line 56 in .github/workflows/pr.yml

View workflow run for this annotation

GitHub Actions / Pull request

Invalid workflow file

The workflow is not valid. .github/workflows/pr.yml (Line: 56, Col: 5): Unexpected value 'matrix'
target:
- name: "dev"
client-id: "0f26a8a6-3593-4eb3-9d74-b2fb814c6fee"
server: "sql-radix-vulnerability-scan-dev.database.windows.net"
env:
connection: >-
Server=${{matrix.target.server}};
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: ${{matrix.target.client-id}}
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
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:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/roles.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/types.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/tables.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/views.sql'
- uses: azure/sql-action@v2.2.1
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/procedures.sql'