Auth0-deploy-cli latest version of action module

Hi! I’m using the auth0-deploy-cli to orchestrate deployment of my tenant, including actions. Recently I got started using an action module to reuse some configuration and code. However, I have to specify a version for the module my action is using. In the yaml syntax it kind of looks like this:

modules:
  - module_name: logger
    module_version_number: 1

My issue is that on every deployment I also release a new version of the module. How can I tell the deploy cli that I want my action to use the latest module version instead of a specific version without having to use the API or the dashboard?

Hi @gerardino.illescas

Welcome to the Auth0 Community!

I understand that you are looking for a version control option in the action module when using auth0-deploy-cli.

With the use of AUTH0_KEYWORD_REPLACE_MAPPINGS you are able to parameterize the module version number in your tenant.yaml and inject the actual latest version dynamically. The correct mappings have to be set in this configuration property, in the resource configuration files, from where keywords can be injected through one of two ways:

  1. @@EXAMPLE_KEY@@: Using the @ symbols causes the tool to perform a JSON.stringify on your value before replacing it. So if your value is a string, the tool will add quotes; if your value is an array or object, the tool will add braces.
  2. ##EXAMPLE_KEY##: Using the # symbol causes the tool to perform a literal replacement; it will not add quotes or braces.

As outlined in the linked documentation, your config.json file should look like so:

{
  "AUTH0_DOMAIN": "test-tenant.us.auth0.com",
  "AUTH0_CLIENT_ID": "FOO",
  "AUTH0_CLIENT_SECRET": "BAR",
  "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
    "ENVIRONMENT": "dev",
    "ALLOWED_LOGOUT_URLS": ["https://dev-test-site.com/logout", "localhost:3000/logout"],
    "ALLOWED_ORIGINS": ["https://dev-test-site.com", "localhost:3000"]
  }
}

Allow me to share some additional resources which can be useful for solving the issue:

Let us know if the provided information have helped you achieve dynamic version control.

Best regards,
Gerald

Hi @gerald.czifra and thanks for your answer!

I understand that you are looking for a version control option in the action module when using auth0-deploy-cli.

Yes, if I could also put it in another way: I would like to automate the box that appears on this screen (from this page) that reads “Outdated modules were detected. Available updates: 1” and then a button that says “Update All”.

Now, regarding your proposal, I couldn’t get it to work because first the AUTH0_KEYWORD_REPLACE_MAPPINGS does not support numbers (there isn’t even a mention about numbers in the whole page, just strings, objects and arrays) and the yaml configuration for auth0-cli the attributes latest_version_number and module_version_number on the actionModules and actions respectively only support numbers.

For example, when using the following:

  module_version_number: '##MODULE_LOGGER_VERSION##'
  # or
  module_version_number: ##MODULE_LOGGER_VERSION## # (without quotes)
  # or 
  module_version_number: @@MODULE_LOGGER_VERSION@@ # using the @@

Then I get the following from the deploy-cli:

error: Schema validation failed loading [
    {
        "keyword": "type",
        "dataPath": ".actions[8].modules[0].module_version_number",
        "schemaPath": "#/properties/actions/items/properties/modules/items/properties/module_version_number/type",
        "params": {
            "type": "number"
        },
        "message": "should be number"
    }
]

Second: the deploy-cli apparently first deploys actions and second modules. Even if I do the following:

actionModules:
  - name: logger
    all_changes_published: true
    code: ./logger/index.js
    latest_version_number: 12 # NOTE THE VERSION IS THE SAME AS THE ACTION BELOW
actions:
  - name: LoginCustomTokens
    code: ./actions/LoginCustomTokens/index.js
    deployed: true
    runtime: node22
    status: built
    supported_triggers:
      - id: post-login
        version: v3
    modules:
      - module_name: logger
        module_version_number: 12 # NOTE THIS IS THE SAME VERSION AS THE MODULE ABOVE

I will get from auth0-cli:

2026-06-08T14:35:44.245Z - error: Could not find action module version id for module 'logger' version '12'

If I could have it my way, I would love that the auth0-deploy-cli would have the option for the action to specify just “latest” version of module. It would look like:

actions:
  - name: LoginCustomTokens
    code: ./actions/LoginCustomTokens/index.js
    deployed: true
    runtime: node22
    status: built
    supported_triggers:
      - id: post-login
        version: v3
    modules:
      - module_name: logger
        module_version_number: latest

And this way I know that if I deploy a new module version, it will automatically update the dependencies using it to that new version. Or at the very least have the second problem I mentioned fixed so that I can synchronize the versions together.