From 0d24b23791e3edcae97e1f387ba25b1ae40973b2 Mon Sep 17 00:00:00 2001 From: Adam Stoffel Date: Wed, 4 Mar 2020 18:24:32 -0800 Subject: [PATCH] Update readme and fix main --- README.md | 5 +++-- dist/index.js | 10 +++++----- src/main.ts | 12 ++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 059b3c3..9aaf784 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ on: push env: clientId: 00000000-0000-0000-0000-000000000000 tenant: my-tenant.onmicrosoft.com + facebookClientSecretKeyContainer: B2C_1A_FacebookSecret jobs: build-and-deploy: @@ -24,8 +25,8 @@ jobs: - name: Upload Facebook Client Secret uses: azure-ad-b2c/deploy-trustframework-keyset-secret@v1 with: - name: ${{ env.FacebookClientSecretKeyContainer }} - value: ${{ secrets.FacebookClientSecret }} + name: ${{ env.facebookClientSecretKeyContainer }} + value: ${{ secrets.facebookClientSecret }} tenant: ${{ env.tenant }} clientId: ${{ env.clientId }} clientSecret: ${{ secrets.clientSecret }} diff --git a/dist/index.js b/dist/index.js index ab1570c..29d2102 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5916,11 +5916,6 @@ function main() { authProvider: new auth_1.ClientCredentialsAuthProvider(tenant, clientId, clientSecret), defaultVersion: "beta" }); - // Then upload the secret - let response = yield client.api(`trustFramework/keySets/${name}/uploadSecret`).post({ - use: "sig", - k: value - }); try { // Create in case it does not already exist yield client.api("trustFramework/keySets").create({ @@ -5928,6 +5923,11 @@ function main() { }); } catch (_b) { } + // Then upload the secret + yield client.api(`trustFramework/keySets/${name}/uploadSecret`).post({ + use: "sig", + k: value + }); core.info("Uploaded secret using Microsoft Graph"); } catch (error) { diff --git a/src/main.ts b/src/main.ts index 8bc9eed..0a4fdf0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,12 +17,6 @@ async function main() { defaultVersion: "beta" }); - // Then upload the secret - let response = await client.api(`trustFramework/keySets/${name}/uploadSecret`).post({ - use: "sig", - k: value - }); - try { // Create in case it does not already exist await client.api("trustFramework/keySets").create({ @@ -30,6 +24,12 @@ async function main() { }); } catch { } + // Then upload the secret + await client.api(`trustFramework/keySets/${name}/uploadSecret`).post({ + use: "sig", + k: value + }); + core.info("Uploaded secret using Microsoft Graph"); } catch (error) { let errorText = error.message ?? error;