Skip to content

Commit 83607e9

Browse files
Adam GoughAdam Gough
authored andcommitted
fix github dropdown
1 parent 578f2c8 commit 83607e9

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

apps/sim/components/ui/tag-dropdown.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ const getOutputTypeForPath = (
109109

110110
if (firstTrigger?.outputs) {
111111
const pathParts = outputPath.split('.')
112-
let currentObj: any = firstTrigger.outputs
112+
// For GitHub trigger, treat 'github' as an implicit root so users can reference fields directly
113+
let currentObj: any =
114+
firstTrigger.id === 'github_webhook' && (firstTrigger as any).outputs.github
115+
? (firstTrigger as any).outputs.github
116+
: firstTrigger.outputs
113117

114118
for (const part of pathParts) {
115119
if (currentObj && typeof currentObj === 'object') {
@@ -421,8 +425,13 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
421425
const firstTrigger = triggers[0]
422426

423427
if (firstTrigger?.outputs) {
428+
// For GitHub trigger, hide the top-level 'github' wrapper for cleaner tags
429+
const outputsRoot =
430+
firstTrigger.id === 'github_webhook' && (firstTrigger as any).outputs.github
431+
? (firstTrigger as any).outputs.github
432+
: firstTrigger.outputs
424433
// Use trigger outputs instead of block outputs
425-
const outputPaths = generateOutputPaths(firstTrigger.outputs)
434+
const outputPaths = generateOutputPaths(outputsRoot)
426435
blockTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`)
427436
} else {
428437
const outputPaths = generateOutputPaths(blockConfig.outputs || {})
@@ -690,8 +699,13 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
690699
const firstTrigger = triggers[0]
691700

692701
if (firstTrigger?.outputs) {
702+
// For GitHub trigger, hide the top-level 'github' wrapper for cleaner tags
703+
const outputsRoot =
704+
firstTrigger.id === 'github_webhook' && (firstTrigger as any).outputs.github
705+
? (firstTrigger as any).outputs.github
706+
: firstTrigger.outputs
693707
// Use trigger outputs instead of block outputs
694-
const outputPaths = generateOutputPaths(firstTrigger.outputs)
708+
const outputPaths = generateOutputPaths(outputsRoot)
695709
blockTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`)
696710
} else {
697711
const outputPaths = generateOutputPaths(blockConfig.outputs || {})

0 commit comments

Comments
 (0)