Skip to content

Commit

Permalink
Merge pull request #2 from Andrews-McMeel-Universal/DEVOPS-XXX-use-ne…
Browse files Browse the repository at this point in the history
…w-docker-based-b2c-action

[DEVOPS-XXX] Use new docker based b2c action
  • Loading branch information
ebronson68 authored Aug 16, 2023
2 parents 6f817a7 + 1776121 commit 23b510a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
needs: [application-ci]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v3
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM ghcr.io/rajbos/actions-marketplace/powershell:7
FROM mcr.microsoft.com/powershell:ubuntu-18.04

WORKDIR /app

COPY entrypoint.ps1 ./
RUN pwsh -Command "Install-Module -Name powershell-yaml -Repository PSGallery"

ENTRYPOINT pwsh -File ./entrypoint.ps1
COPY . .

ENTRYPOINT ["pwsh", "/app/entrypoint.ps1"]
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ git clone https://github.com/Andrews-McMeel-Universal/deploy-trustframework-poli

### Inputs

| Variable | Description | Required | `[Default]` |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | ------------------------------------- |
| `folder` | The folder where the custom policies files are stored | x | `N/A` |
| `files` | Comma delimiter list of policy files | x | `N/A` |
| `tenant` | The full Azure AD B2C tenant name (for example, contoso.onmicrosoft.com) or GUID | x | `N/A` |
| `clientId` | The application Client ID for a service principal which will be used to authenticate to the Microsoft Graph | x | `N/A` |
| `clientSecret` | The application Secret for a service principal which will be used to authenticate to the Microsoft Graph | x | `N/A` |
| `renumberSteps` | Renumber the orchestration steps. Possible values: true, or false | | `false` |
| `addAppInsightsStep` | Add App Insights orchestration steps to the the user journeys. | | `false` |
| `verbose` | Log level verbose. | | `false` |
| Variable | Description | Required | `[Default]` |
| -------------------- | ----------------------------------------------------------------------------------------------------------- | :------: | ----------- |
| `folder` | The folder where the custom policies files are stored | x | `N/A` |
| `files` | Comma delimiter list of policy files | x | `N/A` |
| `tenant` | The full Azure AD B2C tenant name (for example, contoso.onmicrosoft.com) or GUID | x | `N/A` |
| `clientId` | The application Client ID for a service principal which will be used to authenticate to the Microsoft Graph | x | `N/A` |
| `clientSecret` | The application Secret for a service principal which will be used to authenticate to the Microsoft Graph | x | `N/A` |
| `renumberSteps` | Renumber the orchestration steps. Possible values: true, or false | | `false` |
| `addAppInsightsStep` | Add App Insights orchestration steps to the the user journeys. | | `false` |
| `verbose` | Log level verbose. | | `false` |

### Sample workflow

Expand All @@ -42,17 +42,17 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Upload TrustFrameworkBase Policy
uses: azure-ad-b2c/deploy-trustframework-policy@v5
with:
folder: "./Policies"
files: "TrustFrameworkBase.xml,TrustFrameworkExtensions.xml,SignUpOrSignin.xml"
tenant: ${{ env.tenant }}
clientId: ${{ env.clientId }}
clientSecret: ${{ secrets.clientSecret }}
renumberSteps: false
- uses: actions/checkout@v3

- name: Upload TrustFrameworkBase Policy
uses: azure-ad-b2c/deploy-trustframework-policy@v5
with:
folder: "./Policies"
files: "TrustFrameworkBase.xml,TrustFrameworkExtensions.xml,SignUpOrSignin.xml"
tenant: ${{ env.tenant }}
clientId: ${{ env.clientId }}
clientSecret: ${{ secrets.clientSecret }}
renumberSteps: false
```
---
Expand All @@ -64,7 +64,7 @@ jobs:
To update new version you must package this GitHub Action. Use the following commands to package the project:
```bash
npm run-script build
npm run-script build
npm run-script package
```

Expand All @@ -86,7 +86,7 @@ After the build is completed, you can see that the JavaScript files under the [d

### Build issues

The GitHub build runs the scrips as described above. The `lint` script runs the [eslint](https://eslint.org/) command. This command analyzes your code to quickly find problems. You can change the settings of the eslint command in the [.eslintrc.json](.eslintrc.json) file. The following example suppresses some of the errors:
The GitHub build runs the scrips as described above. The `lint` script runs the [eslint](https://eslint.org/) command. This command analyzes your code to quickly find problems. You can change the settings of the eslint command in the [.eslintrc.json](.eslintrc.json) file. The following example suppresses some of the errors:

```json
"rules": {
Expand All @@ -100,7 +100,7 @@ The GitHub build runs the scrips as described above. The `lint` script runs the

### Test the action

When you commit a change to any branch or a PR, the [test.yml](.github/workflows/test.yml) workflow runs with `clientId` parameter set to `test`. The `test` value indicates to the GitHub Action to exit the test successfully. We exit the test because because the required parameters are not configured in this repo.
When you commit a change to any branch or a PR, the [test.yml](.github/workflows/test.yml) workflow runs with `clientId` parameter set to `test`. The `test` value indicates to the GitHub Action to exit the test successfully. We exit the test because because the required parameters are not configured in this repo.

To test the GitHub Action create your own repo, add the workflow. Then configure the [uses](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses) to point to your branch, fork, or commit. The following example demonstrate how to configure the workflow to use the latest commit in the `vNext` branch.

Expand Down
23 changes: 8 additions & 15 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,24 @@ branding:

inputs:
folder:
description: 'The folder where the custom policies files are stored'
description: "The folder where the custom policies files are stored"
required: true
files:
description: 'Comma delimiter list of policy files'
description: "Comma delimiter list of policy files"
required: true
tenantDomain:
description: 'The full Azure AD B2C tenant name (for example, contoso.onmicrosoft.com) or GUID'
description: "The full Azure AD B2C tenant name (for example, contoso.onmicrosoft.com) or GUID"
required: true
tenantId:
description: 'The full GUID of the Azure AD B2C tenant ID'
description: "The full GUID of the Azure AD B2C tenant ID"
required: true
clientId:
description: 'The application Client ID for a service principal which will be used to authenticate to the Microsoft Graph'
description: "The application Client ID for a service principal which will be used to authenticate to the Microsoft Graph"
required: true
clientSecret:
description: 'The application Secret for a service principal which will be used to authenticate to the Microsoft Graph'
description: "The application Secret for a service principal which will be used to authenticate to the Microsoft Graph"
required: true

runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.clientId }}
- ${{ inputs.clientSecret }}
- ${{ inputs.tenantId }}
- ${{ inputs.folder }}
- ${{ inputs.files }}
- ${{ inputs.tenantDomain }}
using: "docker"
image: "Dockerfile"

0 comments on commit 23b510a

Please sign in to comment.