From 5adc43077515d504fb5c63cb7284305dedf0079f Mon Sep 17 00:00:00 2001 From: Sam Kaplan Date: Mon, 5 Dec 2022 10:58:36 -0600 Subject: [PATCH] update credential handling --- .github/workflows/Test.yml | 6 ++++-- test/runtests.jl | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 4d1483d..c031e68 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v1.0.0 - uses: azure/login@v1.1 with: - creds: ${{ secrets.AZURE_CREDENTIALS }} + creds: '{"clientId":"${{ secrets.CLIENT_ID }}","clientSecret":"${{ secrets.CLIENT_SECRET }}","subscriptionId":"${{ secrets.SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TENANT_ID }}"}' - uses: julia-actions/setup-julia@latest with: version: ${{ matrix.julia-version }} @@ -26,7 +26,9 @@ jobs: - uses: julia-actions/julia-buildpkg@latest #change lastest to master - uses: julia-actions/julia-runtest@latest #change lastest to master env: - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} + CLIENT_ID: ${{ secrets.CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} + TENANT: ${{ secrets.TENANT_ID }} STORAGE_ACCOUNT: "s${{ steps.uuid.outputs.uuid }}" - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 diff --git a/test/runtests.jl b/test/runtests.jl index e66df4c..a064308 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,10 +35,12 @@ function robust_open(c, s...) end end -credentials = JSON.parse(ENV["AZURE_CREDENTIALS"]) -AzSessions.write_manifest(;client_id=credentials["clientId"], client_secret=credentials["clientSecret"], tenant=credentials["tenantId"]) +client_id = ENV["CLIENT_ID"] +client_secret = ENV["CLIENT_SECRET"] +tenant = ENV["TENANT"] +AzSessions.write_manifest(;client_id, client_secret, tenant) -session = AzSession(;protocal=AzClientCredentials, client_id=credentials["clientId"], client_secret=credentials["clientSecret"], resource="https://storage.azure.com/") +session = AzSession(;protocal=AzClientCredentials, client_id, client_secret, resource="https://storage.azure.com/") storageaccount = ENV["STORAGE_ACCOUNT"] @info "storageaccount=$storageaccount"