Skip to content

feat(actions): add --module flag to associate action modules - #1605

Open
developerkunal wants to merge 1 commit into
mainfrom
DXCDT-2170/actions-module-flag
Open

feat(actions): add --module flag to associate action modules#1605
developerkunal wants to merge 1 commit into
mainfrom
DXCDT-2170/actions-module-flag

Conversation

@developerkunal

@developerkunal developerkunal commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🔧 Changes

Adds a repeatable --module (-m) flag to auth0 actions create and auth0 actions update for associating action modules with an action.

Each flag value is a comma-separated set of key=value pairs whose keys mirror the Management API field names, so agents and users can map directly from the API structure without translation:

  • module_id (required) — the module UUID
  • module_version_id (required) — the UUID of the specific module version to attach

The flag can be passed multiple times to associate several modules. The associated modules render as a new MODULES row in the action's detail output (and in the modules array under --json).

This PR also fixes two pre-existing bugs in auth0 actions update that surfaced when running a flag-only (non-interactive) update:

  • The update payload sent "name": null because Name was never seeded from the existing action, and the SDK's Action.Name field has no omitempty. The API rejected this with 400 ... Expected type string but found type null. Name is now seeded from the existing action, so a partial update no longer blanks it.
  • Answering "No" to the "Do you want to save the action code?" prompt aborted the entire update, silently discarding other changes such as --module. The code editor and its save confirmation now run only when the update actually touches code (either --code is passed, or the fully interactive no-flag path). This also applies to --name, --runtime, --secret, and --dependency updates, which previously hit the same issues.

📚 References

🔬 Testing

  • Added TestActionsInputModulesToActionModules covering the parser: single and multiple modules, empty input, malformed pairs, missing module_id, missing module_version_id, and unknown keys.
  • Added TestActionsUpdateCmd asserting a module-only update carries the existing name forward and sends the correct modules payload.
  • Added TestFormatActionModules covering the display rendering (id only, name plus version, and multiple modules).
  • Verified end-to-end against a live tenant: create and update with one and multiple modules, confirmed the MODULES row renders and the association persists on actions show.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

Add a repeatable --module flag to `auth0 actions create` and
`auth0 actions update` for associating action modules. Each value is a
comma-separated set of key=value pairs matching the Management API field
names (module_id, module_version_id), both required.

Also fix two pre-existing bugs in `auth0 actions update` that surfaced
with non-code flag updates: the payload sent `name: null` (rejected with
a 400) because Name was never seeded from the existing action, and
answering "No" to the code save prompt discarded the entire update. The
code editor and its save confirmation now only run when the update
actually touches code.
@developerkunal
developerkunal requested a review from a team as a code owner August 10, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant