- Go to the Auth0 > Applications > Applications and click * Create Application*.
- Choose Machine to Machine Application.
- Give it a name like Actions Updater and click Create.
- Select the Auth0 Management API from the APIs list.
- Check the create:actions, read:actions, update:actions permissions and click Authorize.
- Go to the Settings tab and copy the Domain, Client ID and Client Secret.
- Add the Domain, Client ID and Client Secret as secrets to your repository. Recommended names are AUTH0_TENANT_DOMAIN, AUTH0_CLIENT_ID and AUTH0_CLIENT_SECRET.
- Go to the Auth0 > Actions > Library and select the Custom tab.
- Click on the action you want to update.
- Copy the Action ID from the URL. For example in the following action https://manage.auth0.com/dashboard/eu/_/actions/library/details/4cf1a082-ef6f-460c-9ce2-ae6f3b027a68 the id is 4cf1a082-ef6f-460c-9ce2-ae6f3b027a68.
- Basic use case
actions:
post_login:
- id: '4cf1a082-ef6f-460c-9ce2-ae6f3b027a68'
name: 'My Very First Post-Login Action'
code_file_path: './post-login.js'- Advanced use case
actions:
post_login:
- id: '4cf1a082-ef6f-460c-9ce2-ae6f3b027a68'
name: 'My Very First Post-Login Action'
code_file_path: './post-login.js'
dependencies:
- name: 'axios'
- name: 'lodash'
version: '1.0.0'
secrets:
- key: 'API_BASE'
value: 'https://api.example.com'
- key: 'API_TOKEN'
env_key: 'SOME_TOKEN_KEY_IN_GITHUB_SECRETS'Note: secrets not defined in the config.yml will be removed from your Auth0 trigger on deployment.
Note: be sure to expose SOME_TOKEN_KEY_IN_GITHUB_SECRETS as an environment variable to this action.
| Name | Description | Required | Default |
|---|---|---|---|
auth0_client_id |
The Auth0 Client ID. | ✔️ | |
auth0_client_secret |
The Auth0 Client Secret. | ✔️ | |
auth0_tenant_domain |
The Auth0 Tenant Domain. | ✔️ | |
config_path |
The path to the Auth0 Actions-As-Code configuration file. | config.yml | |
actions_runtime |
The runtime version of your action. | node22 |
Note: make sure to update your action version to the latest release.
uses: stefanoschrs/auth0-actions-as-code@v1.0.1
with:
auth0_client_id: ${{ secrets.AUTH0_CLIENT_ID }}
auth0_client_secret: ${{ secrets.AUTH0_CLIENT_SECRET }}
auth0_tenant_domain: ${{ secrets.AUTH0_TENANT_DOMAIN }}uses: stefanoschrs/auth0-actions-as-code@v1.0.1
env:
SOME_TOKEN_KEY_IN_GITHUB_SECRETS: ${{ secrets.SOME_TOKEN_KEY_IN_GITHUB_SECRETS }}
with:
auth0_client_id: ${{ secrets.AUTH0_CLIENT_ID }}
auth0_client_secret: ${{ secrets.AUTH0_CLIENT_SECRET }}
auth0_tenant_domain: ${{ secrets.AUTH0_TENANT_DOMAIN }}
config_path: ./path-to-config.yml
actions_runtime: 'node22'