Skip to content

Commit

Permalink
Update readme and fix main
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Stoffel committed Mar 5, 2020
1 parent 4aec266 commit 0d24b23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5916,18 +5916,18 @@ 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({
id: name
});
}
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) {
Expand Down
12 changes: 6 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ 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({
id: name
});
} 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;
Expand Down

0 comments on commit 0d24b23

Please sign in to comment.