-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.45 KB
/
b2c-ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: B2C Application CI
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
AZURE_CREDENTIALS:
required: true
jobs:
application-ci:
name: Application CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use .env cache action
uses: Andrews-McMeel-Universal/get-envs@v1
with:
azurecredentials: ${{ secrets.AZURE_CREDENTIALS }}
environment: ${{ inputs.environment }}
- name: Use cache-next-install action
uses: Andrews-McMeel-Universal/cache-next-install@v1
- run: yarn build
- name: Check Generated B2C Policies
shell: pwsh
run: |
# Get TenantId
$TenantId = "${{ env.AZURE_B2C_TENANT_ID }}"
# Get the list of files to upload
$Folder = "./dist/custom-policies/"
$Files = Get-ChildItem $Folder | ForEach-Object { $_.name }
# Check each B2C policy
foreach ($File in $Files) {
$XML = New-Object xml
$XML.Load((Convert-Path "$Folder/$File"))
if (! $XML.TrustFrameworkPolicy.TenantObjectId -eq $TenantId ) {
Write-Error "Variables in $File were not substituted correctly"
exit 1
}
}
- name: Check B2C index.html file
run: grep "${{ env.AUTH_ASSETS_RESOURCE_URL }}" dist/index.html