Skip to content

Commit 9ffe19a

Browse files
committed
Add initial source
1 parent 616e97a commit 9ffe19a

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# GitHub Action for Auth0 Deploy CLI
2+
This action for [auth0-deploy-cli](https://github.com/auth0/auth0-deploy-cli) enables
3+
arbitrary actions with the `a0deploy` command, including import and export of tenant
4+
configuration.
5+
6+
### Usage
7+
An example configuration deploying tenant configuration from the project where this
8+
workflow is running. The tenant input file is expected to be at `./tenant.yml`.
9+
10+
```yaml
11+
name: Auth0 Deploy Tenant
12+
on: [push]
13+
14+
jobs:
15+
import:
16+
name: Import Tenant Configuration
17+
uses: twyla-ai/action-auth0-deploy-cli@master
18+
with:
19+
domain: "<tenant>.auth0.com"
20+
id: ${{ secrets.AUTH0_CLIENT_ID }}
21+
secret: ${{ secrets.AUTH0_CLIENT_SECRET }}
22+
args: "import -i tenant.yml"
23+
env:
24+
AUTH0_ALLOW_DELETE: "true"
25+
```
26+
27+
#### Example With Keyword Replace Mappings
28+
Consider a scenario where the following config file is normally used.
29+
30+
```json
31+
{
32+
"AUTH0_DOMAIN": "<tenant>.auth0.com",
33+
"AUTH0_CLIENT_ID": "<auth0-client-id>",
34+
"AUTH0_CLIENT_SECRET": "<auth-client-secret>",
35+
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
36+
"CONNECTION_GOOGLE_CLIENT_ID": "<value>",
37+
"CONNECTION_GOOGLE_CLIENT_SECRET": "<value>",
38+
"CALLBACK_URL": "http://localhost:8080"
39+
}
40+
}
41+
```
42+
43+
This can be configured via the action as follows. Note that additional config file can
44+
also be specified by appending `-c ./path/to/config.json` to args.
45+
46+
```yaml
47+
name: Import Tenant Configuration
48+
uses: twyla-ai/action-auth0-deploy-cli@master
49+
with:
50+
domain: "<tenant>.auth0.com"
51+
id: ${{ secrets.AUTH0_CLIENT_ID }}
52+
secret: ${{ secrets.AUTH0_CLIENT_SECRET }}
53+
args: "import"
54+
env:
55+
AUTH0_INPUT_FILE: ./tenant.yaml
56+
CONNECTION_GOOGLE_CLIENT_ID: "<value>"
57+
CONNECTION_GOOGLE_CLIENT_SECRET: "<value>"
58+
CALLBACK_URL: http://localhost:8080
59+
```
60+
61+
### Environment Variables
62+
Any environment variable respected by the underlying `a0deploy` command can be passed in
63+
via `env`.

action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Auth0 Deploy CLI Action
2+
description: A GitHub Action wrapping auth0-deploy-cli
3+
author: Twyla GmbH
4+
branding:
5+
icon: shield
6+
color: orange
7+
8+
inputs:
9+
domain:
10+
description: Auth0 Domain
11+
required: true
12+
id:
13+
description: Auth0 Client ID
14+
required: true
15+
secret:
16+
description: Auth0 Client Secret
17+
required: true
18+
runs:
19+
using: docker
20+
image: docker://quay.io/abn/auth0-deploy-cli:v3.6.0
21+
env:
22+
AUTH0_DOMAIN: ${{ inputs.domain }}
23+
AUTH0_CLIENT_ID: ${{ inputs.id }}
24+
AUTH0_CLIENT_SECRET: ${{ inputs.secret }}

0 commit comments

Comments
 (0)