Skip to content

Commit 958360b

Browse files
Adam GoughAdam Gough
authored andcommitted
test
1 parent 5e3c02c commit 958360b

1 file changed

Lines changed: 6 additions & 22 deletions

File tree

apps/sim/executor/resolver/resolver.ts

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -547,17 +547,9 @@ export class InputResolver {
547547
// This enables direct access to <start.input> and <start.conversationId>
548548
let replacementValue: any = blockState.output
549549

550-
// If top-level access fails but nested github exists, start traversal from github
551-
if (
552-
Array.isArray(pathParts) &&
553-
pathParts.length > 0 &&
554-
replacementValue &&
555-
typeof replacementValue === 'object' &&
556-
replacementValue[pathParts[0]] === undefined &&
557-
replacementValue.github &&
558-
typeof replacementValue.github === 'object'
559-
) {
560-
replacementValue = replacementValue.github
550+
// Merge nested github object onto root to make <block.repository> resolve transparently
551+
if (replacementValue && typeof replacementValue === 'object' && replacementValue.github && typeof replacementValue.github === 'object') {
552+
replacementValue = { ...replacementValue.github, ...replacementValue }
561553
}
562554

563555
for (const part of pathParts) {
@@ -772,17 +764,9 @@ export class InputResolver {
772764

773765
let replacementValue: any = blockState.output
774766

775-
// If top-level access fails but nested github exists, start traversal from github
776-
if (
777-
Array.isArray(pathParts) &&
778-
pathParts.length > 0 &&
779-
replacementValue &&
780-
typeof replacementValue === 'object' &&
781-
replacementValue[pathParts[0]] === undefined &&
782-
replacementValue.github &&
783-
typeof replacementValue.github === 'object'
784-
) {
785-
replacementValue = replacementValue.github
767+
// Merge nested github object onto root to make <block.repository> resolve transparently
768+
if (replacementValue && typeof replacementValue === 'object' && replacementValue.github && typeof replacementValue.github === 'object') {
769+
replacementValue = { ...replacementValue.github, ...replacementValue }
786770
}
787771

788772
for (const part of pathParts) {

0 commit comments

Comments
 (0)