[GH-ISSUE #659] [Bug] Secret Interpolation error in Actions possible caused by wrong RegExp #13636

Closed
opened 2026-05-20 15:33:26 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @FDHoho007 on GitHub (Jul 12, 2025).
Original GitHub issue: https://github.com/moghtech/komodo/issues/659

I tried writing an action that looks something like this:

const foo = {};
const bar = {"hi": "hello"};
const key = "hi";
const value = "world";
console.log("[[DATABASE_PASSWORD]]");
foo[bar[key]] = value;

This action fails with this error:

error: The module's source code could not be parsed: Expected ']', got ';' at file:///action-cache/mbBSJt8ZQo.ts:30:20

  foo[bar[key = value;

If I instead use a variable for bar[key] and therefore not have two closing brackets in my code it works.

const bk = bar[key];
foo[bk] = value;

I therefore assume that the secret interpolation uses a regular expression, that is not lazy and therefore does not take the nearest closing double brackets but any closing bracket pair. Unfortunately I just started using Komodo and am not familiar enough with the code base to look for the error cause myself.

Originally created by @FDHoho007 on GitHub (Jul 12, 2025). Original GitHub issue: https://github.com/moghtech/komodo/issues/659 I tried writing an action that looks something like this: ``` const foo = {}; const bar = {"hi": "hello"}; const key = "hi"; const value = "world"; console.log("[[DATABASE_PASSWORD]]"); foo[bar[key]] = value; ``` This action fails with this error: ``` error: The module's source code could not be parsed: Expected ']', got ';' at file:///action-cache/mbBSJt8ZQo.ts:30:20 foo[bar[key = value; ``` If I instead use a variable for `bar[key]` and therefore not have two closing brackets in my code it works. ``` const bk = bar[key]; foo[bk] = value; ``` I therefore assume that the secret interpolation uses a regular expression, that is not lazy and therefore does not take the nearest closing double brackets but any closing bracket pair. Unfortunately I just started using Komodo and am not familiar enough with the code base to look for the error cause myself.
Author
Owner

@mbecker20 commented on GitHub (Jul 12, 2025):

Thanks for the report, I do believe this is a bug in the variable interpolation, it cannot handle this case correctly.

The code for interpolation is already isolated in its own codebase: https://github.com/mbecker20/svi

<!-- gh-comment-id:3066269780 --> @mbecker20 commented on GitHub (Jul 12, 2025): Thanks for the report, I do believe this is a bug in the variable interpolation, it cannot handle this case correctly. The code for interpolation is already isolated in its own codebase: https://github.com/mbecker20/svi
Author
Owner

@FDHoho007 commented on GitHub (Jul 13, 2025):

See https://github.com/mbecker20/svi/pull/1

This PR should solve this issue.

<!-- gh-comment-id:3067118533 --> @FDHoho007 commented on GitHub (Jul 13, 2025): See https://github.com/mbecker20/svi/pull/1 This PR should solve this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#13636