Deploy and Enable Actions Using Auth0 Deploy CLI

Problem statement

When using auth0-cli to deploy Actions, they are getting deployed but not bound to the flow and run. For example, the following YAML code is run using Auth0 Deploy CLI:

# Auth0-Deploy-CLI Tenant YAML Configuration

actions:
  - name: action-example
    code: ./actions/action-example/code.js
    dependencies:
      - name: lodash
        version: 4.17.21
    deployed: true
    status: built
    supported_triggers:
      - id: post-login
        version: v2

This article explains how to deploy the actions using auth0-cli.

Solution

The solution is to also update the trigger bindings using the Auth0 Deploy CLI. This can be done within the Auth0 Deploy CLI configuration. Here is a full example:

# Auth0-Deploy-CLI Tenant YAML Configuration

actions:
  - name: action-example
    code: ./actions/action-example/code.js
    dependencies:
      - name: lodash
        version: 4.17.21
    deployed: true
    status: built
    supported_triggers:
      - id: post-login
        version: v2

triggers:
  post-login:
    - action_name: action-example
      display_name: action-example