Skip to content

Commit 2900bc8

Browse files
Adam GoughAdam Gough
authored andcommitted
github test fix
1 parent b3f19c6 commit 2900bc8

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,13 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
422422

423423
if (firstTrigger?.outputs) {
424424
// Use trigger outputs instead of block outputs
425-
const outputPaths = generateOutputPaths(firstTrigger.outputs)
425+
let outputPaths = generateOutputPaths(firstTrigger.outputs)
426+
// UX: For GitHub trigger, only expose repository paths at root
427+
if ((firstTrigger as any)?.provider === 'github') {
428+
outputPaths = outputPaths
429+
.filter((p) => p === 'github.repository' || p.startsWith('github.repository.'))
430+
.map((p) => p.slice('github.'.length))
431+
}
426432
blockTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`)
427433
} else {
428434
const outputPaths = generateOutputPaths(blockConfig.outputs || {})
@@ -691,7 +697,13 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
691697

692698
if (firstTrigger?.outputs) {
693699
// Use trigger outputs instead of block outputs
694-
const outputPaths = generateOutputPaths(firstTrigger.outputs)
700+
let outputPaths = generateOutputPaths(firstTrigger.outputs)
701+
// UX: For GitHub trigger, only expose repository paths at root
702+
if ((firstTrigger as any)?.provider === 'github') {
703+
outputPaths = outputPaths
704+
.filter((p) => p === 'github.repository' || p.startsWith('github.repository.'))
705+
.map((p) => p.slice('github.'.length))
706+
}
695707
blockTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`)
696708
} else {
697709
const outputPaths = generateOutputPaths(blockConfig.outputs || {})

apps/sim/lib/webhooks/utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,16 @@ export function formatWebhookInput(
612612
// Top-level properties for backward compatibility
613613
...githubData,
614614

615+
// Expose common raw GitHub sub-objects at the top level for direct access
616+
// This allows references like <github1.repository> and <github1.sender>
617+
// without requiring the intermediate "github" namespace.
618+
// Avoid keys that already exist in githubData (e.g., commits, issue, pull_request, comment)
619+
// to prevent type/value conflicts.
620+
...(repository && { repository }),
621+
...(sender && { sender }),
622+
...(body?.organization && { organization: body.organization }),
623+
...(body?.installation && { installation: body.installation }),
624+
615625
// GitHub data structured for trigger handler to extract
616626
github: {
617627
// Processed convenience variables

0 commit comments

Comments
 (0)