chore: import upstream snapshot with attribution
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export { githubIssueClosedTrigger } from './issue_closed'
|
||||
export { githubIssueCommentTrigger } from './issue_comment'
|
||||
export { githubIssueOpenedTrigger } from './issue_opened'
|
||||
export { githubPRClosedTrigger } from './pr_closed'
|
||||
export { githubPRCommentTrigger } from './pr_comment'
|
||||
export { githubPRMergedTrigger } from './pr_merged'
|
||||
export { githubPROpenedTrigger } from './pr_opened'
|
||||
export { githubPRReviewedTrigger } from './pr_reviewed'
|
||||
export { githubPushTrigger } from './push'
|
||||
export { githubReleasePublishedTrigger } from './release_published'
|
||||
export { githubWebhookTrigger } from './webhook'
|
||||
export { githubWorkflowRunTrigger } from './workflow_run'
|
||||
@@ -0,0 +1,329 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubIssueClosedTrigger: TriggerConfig = {
|
||||
id: 'github_issue_closed',
|
||||
name: 'GitHub Issue Closed',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when an issue is closed in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>issues</strong> (<strong>closed</strong> action).',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_closed',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description:
|
||||
'GitHub event type from X-GitHub-Event header (e.g., issues, pull_request, push)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (opened, closed, reopened, edited, etc.)',
|
||||
},
|
||||
issue: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Issue ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Issue node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Issue number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Issue title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Issue body/description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Issue state (open, closed)',
|
||||
},
|
||||
state_reason: {
|
||||
type: 'string',
|
||||
description: 'Reason for state (completed, not_planned, reopened)',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Issue HTML URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
labels: {
|
||||
type: 'array',
|
||||
description: 'Array of label objects',
|
||||
},
|
||||
assignees: {
|
||||
type: 'array',
|
||||
description: 'Array of assigned users',
|
||||
},
|
||||
milestone: {
|
||||
type: 'object',
|
||||
description: 'Milestone object if assigned',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Issue creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Issue last update timestamp',
|
||||
},
|
||||
closed_at: {
|
||||
type: 'string',
|
||||
description: 'Issue closed timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'issues',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubIssueCommentTrigger: TriggerConfig = {
|
||||
id: 'github_issue_comment',
|
||||
name: 'GitHub Issue Comment',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when a comment is added to an issue (not pull requests)',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>issue_comment</strong> (<strong>created, edited, deleted</strong> actions).',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
'<strong>Note:</strong> This trigger filters for issue comments only. For PR comments, use the "GitHub PR Comment" trigger.',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_comment',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., issue_comment)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (created, edited, deleted)',
|
||||
},
|
||||
issue: {
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Issue number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Issue title',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Issue state (open, closed)',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Issue HTML URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
comment: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Comment ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Comment node ID',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Comment text',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Comment HTML URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Comment creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Comment last update timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'issue_comment',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubIssueOpenedTrigger: TriggerConfig = {
|
||||
id: 'github_issue_opened',
|
||||
name: 'GitHub Issue Opened',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when a new issue is opened in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'selectedTriggerId',
|
||||
title: 'Trigger Type',
|
||||
type: 'dropdown',
|
||||
mode: 'trigger',
|
||||
options: [
|
||||
{ label: 'Issue Opened', id: 'github_issue_opened' },
|
||||
{ label: 'Issue Closed', id: 'github_issue_closed' },
|
||||
{ label: 'Issue Comment', id: 'github_issue_comment' },
|
||||
{ label: 'PR Opened', id: 'github_pr_opened' },
|
||||
{ label: 'PR Closed', id: 'github_pr_closed' },
|
||||
{ label: 'PR Merged', id: 'github_pr_merged' },
|
||||
{ label: 'PR Comment', id: 'github_pr_comment' },
|
||||
{ label: 'PR Reviewed', id: 'github_pr_reviewed' },
|
||||
{ label: 'Code Push', id: 'github_push' },
|
||||
{ label: 'Release Published', id: 'github_release_published' },
|
||||
{ label: 'Actions Workflow Run', id: 'github_workflow_run' },
|
||||
],
|
||||
value: () => 'github_issue_opened',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>issues</strong> (<strong>opened</strong> action).',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_issue_opened',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description:
|
||||
'GitHub event type from X-GitHub-Event header (e.g., issues, pull_request, push)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (opened, closed, reopened, edited, etc.)',
|
||||
},
|
||||
issue: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Issue ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Issue node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Issue number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Issue title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Issue body/description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Issue state (open, closed)',
|
||||
},
|
||||
state_reason: {
|
||||
type: 'string',
|
||||
description: 'Reason for state (completed, not_planned, reopened)',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Issue HTML URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
labels: {
|
||||
type: 'array',
|
||||
description: 'Array of label objects',
|
||||
},
|
||||
assignees: {
|
||||
type: 'array',
|
||||
description: 'Array of assigned users',
|
||||
},
|
||||
milestone: {
|
||||
type: 'object',
|
||||
description: 'Milestone object if assigned',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Issue creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Issue last update timestamp',
|
||||
},
|
||||
closed_at: {
|
||||
type: 'string',
|
||||
description: 'Issue closed timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'issues',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubPRClosedTrigger: TriggerConfig = {
|
||||
id: 'github_pr_closed',
|
||||
name: 'GitHub PR Closed',
|
||||
provider: 'github',
|
||||
description:
|
||||
'Trigger workflow when a pull request is closed without being merged (e.g., abandoned) in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_closed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>pull_request</strong> (<strong>closed</strong> action).',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_closed',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., pull_request)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (opened, closed, synchronize, reopened, edited, etc.)',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
pull_request: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Pull request ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Pull request node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Pull request title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Pull request description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Pull request state (open, closed)',
|
||||
},
|
||||
merged: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR was merged',
|
||||
},
|
||||
merged_at: {
|
||||
type: 'string',
|
||||
description: 'Timestamp when PR was merged',
|
||||
},
|
||||
merged_by: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
draft: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR is a draft',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request HTML URL',
|
||||
},
|
||||
diff_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request diff URL',
|
||||
},
|
||||
patch_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request patch URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
head: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Source branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Source branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Source repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Source repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
base: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Target branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Target branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Target repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Target repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
additions: {
|
||||
type: 'number',
|
||||
description: 'Number of lines added',
|
||||
},
|
||||
deletions: {
|
||||
type: 'number',
|
||||
description: 'Number of lines deleted',
|
||||
},
|
||||
changed_files: {
|
||||
type: 'number',
|
||||
description: 'Number of files changed',
|
||||
},
|
||||
labels: {
|
||||
type: 'array',
|
||||
description: 'Array of label objects',
|
||||
},
|
||||
assignees: {
|
||||
type: 'array',
|
||||
description: 'Array of assigned users',
|
||||
},
|
||||
requested_reviewers: {
|
||||
type: 'array',
|
||||
description: 'Array of requested reviewers',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request last update timestamp',
|
||||
},
|
||||
closed_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request closed timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'pull_request',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubPRCommentTrigger: TriggerConfig = {
|
||||
id: 'github_pr_comment',
|
||||
name: 'GitHub PR Comment',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when a comment is added to a pull request in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_comment',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>Issue comments</strong>.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
'Note: Pull request comments use the issue_comment event. You can filter for PR comments by checking if issue.pull_request exists.',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_comment',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., issue_comment)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (created, edited, deleted)',
|
||||
},
|
||||
issue: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Issue ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Issue node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Issue/PR number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Issue/PR title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Issue/PR description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Issue/PR state (open, closed)',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Issue/PR HTML URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
labels: {
|
||||
type: 'array',
|
||||
description: 'Array of label objects',
|
||||
},
|
||||
assignees: {
|
||||
type: 'array',
|
||||
description: 'Array of assigned users',
|
||||
},
|
||||
pull_request: {
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Pull request API URL (present only for PR comments)',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request HTML URL',
|
||||
},
|
||||
diff_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request diff URL',
|
||||
},
|
||||
patch_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request patch URL',
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Issue/PR creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Issue/PR last update timestamp',
|
||||
},
|
||||
},
|
||||
comment: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Comment ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Comment node ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Comment API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Comment HTML URL',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Comment text',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Comment creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Comment last update timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Owner node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'issue_comment',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubPRMergedTrigger: TriggerConfig = {
|
||||
id: 'github_pr_merged',
|
||||
name: 'GitHub PR Merged',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when a pull request is successfully merged in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_merged',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_merged',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_merged',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_merged',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>pull_request</strong>. Note: Merged PRs have <strong>action=\'closed\'</strong> AND <strong>merged=true</strong>.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_merged',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., pull_request)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (opened, closed, synchronize, reopened, edited, etc.)',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
pull_request: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Pull request ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Pull request node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Pull request title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Pull request description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Pull request state (open, closed)',
|
||||
},
|
||||
merged: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR was merged',
|
||||
},
|
||||
merged_at: {
|
||||
type: 'string',
|
||||
description: 'Timestamp when PR was merged',
|
||||
},
|
||||
merged_by: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
draft: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR is a draft',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request HTML URL',
|
||||
},
|
||||
diff_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request diff URL',
|
||||
},
|
||||
patch_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request patch URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
head: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Source branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Source branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Source repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Source repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
base: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Target branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Target branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Target repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Target repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
additions: {
|
||||
type: 'number',
|
||||
description: 'Number of lines added',
|
||||
},
|
||||
deletions: {
|
||||
type: 'number',
|
||||
description: 'Number of lines deleted',
|
||||
},
|
||||
changed_files: {
|
||||
type: 'number',
|
||||
description: 'Number of files changed',
|
||||
},
|
||||
labels: {
|
||||
type: 'array',
|
||||
description: 'Array of label objects',
|
||||
},
|
||||
assignees: {
|
||||
type: 'array',
|
||||
description: 'Array of assigned users',
|
||||
},
|
||||
requested_reviewers: {
|
||||
type: 'array',
|
||||
description: 'Array of requested reviewers',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request last update timestamp',
|
||||
},
|
||||
closed_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request closed timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'pull_request',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,426 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubPROpenedTrigger: TriggerConfig = {
|
||||
id: 'github_pr_opened',
|
||||
name: 'GitHub PR Opened',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when a new pull request is opened in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_opened',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>pull_request</strong> (<strong>opened</strong> action).',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_opened',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., pull_request)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (opened, closed, synchronize, reopened, edited, etc.)',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
pull_request: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Pull request ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Pull request node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Pull request title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Pull request description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Pull request state (open, closed)',
|
||||
},
|
||||
merged: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR was merged',
|
||||
},
|
||||
merged_at: {
|
||||
type: 'string',
|
||||
description: 'Timestamp when PR was merged',
|
||||
},
|
||||
merged_by: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
draft: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR is a draft',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request HTML URL',
|
||||
},
|
||||
diff_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request diff URL',
|
||||
},
|
||||
patch_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request patch URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
head: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Source branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Source branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Source repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Source repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
base: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Target branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Target branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Target repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Target repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
additions: {
|
||||
type: 'number',
|
||||
description: 'Number of lines added',
|
||||
},
|
||||
deletions: {
|
||||
type: 'number',
|
||||
description: 'Number of lines deleted',
|
||||
},
|
||||
changed_files: {
|
||||
type: 'number',
|
||||
description: 'Number of files changed',
|
||||
},
|
||||
labels: {
|
||||
type: 'array',
|
||||
description: 'Array of label objects',
|
||||
},
|
||||
assignees: {
|
||||
type: 'array',
|
||||
description: 'Array of assigned users',
|
||||
},
|
||||
requested_reviewers: {
|
||||
type: 'array',
|
||||
description: 'Array of requested reviewers',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request last update timestamp',
|
||||
},
|
||||
closed_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request closed timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'pull_request',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubPRReviewedTrigger: TriggerConfig = {
|
||||
id: 'github_pr_reviewed',
|
||||
name: 'GitHub PR Reviewed',
|
||||
provider: 'github',
|
||||
description:
|
||||
'Trigger workflow when a pull request review is submitted, edited, or dismissed in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_reviewed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_reviewed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_reviewed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_reviewed',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>Pull request reviews</strong>.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_pr_reviewed',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., pull_request_review)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (submitted, edited, dismissed)',
|
||||
},
|
||||
review: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Review ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Review node ID',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Reviewer username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Reviewer user ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Reviewer node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Reviewer avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Reviewer profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Review comment text',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Review state (approved, changes_requested, commented, dismissed)',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Review HTML URL',
|
||||
},
|
||||
submitted_at: {
|
||||
type: 'string',
|
||||
description: 'Review submission timestamp',
|
||||
},
|
||||
commit_id: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA that was reviewed',
|
||||
},
|
||||
author_association: {
|
||||
type: 'string',
|
||||
description: 'Author association (OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, etc.)',
|
||||
},
|
||||
},
|
||||
pull_request: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Pull request ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Pull request node ID',
|
||||
},
|
||||
number: {
|
||||
type: 'number',
|
||||
description: 'Pull request number',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
description: 'Pull request title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Pull request description',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Pull request state (open, closed)',
|
||||
},
|
||||
merged: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR was merged',
|
||||
},
|
||||
draft: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the PR is a draft',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request HTML URL',
|
||||
},
|
||||
diff_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request diff URL',
|
||||
},
|
||||
patch_url: {
|
||||
type: 'string',
|
||||
description: 'Pull request patch URL',
|
||||
},
|
||||
user: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'PR author username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'PR author user ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'PR author node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'PR author avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'PR author profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
head: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Source branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Source branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Source repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Source repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
base: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Target branch name',
|
||||
},
|
||||
sha: {
|
||||
type: 'string',
|
||||
description: 'Target branch commit SHA',
|
||||
},
|
||||
repo: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Target repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Target repository full name',
|
||||
},
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Pull request last update timestamp',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Owner node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'pull_request_review',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,426 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubPushTrigger: TriggerConfig = {
|
||||
id: 'github_push',
|
||||
name: 'GitHub Push',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when code is pushed to a repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_push',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_push',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_push',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_push',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>Pushes</strong>.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_push',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., push)',
|
||||
},
|
||||
branch: {
|
||||
type: 'string',
|
||||
description: 'Branch name derived from ref (e.g., main from refs/heads/main)',
|
||||
},
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Git reference that was pushed (e.g., refs/heads/main)',
|
||||
},
|
||||
before: {
|
||||
type: 'string',
|
||||
description: 'SHA of the commit before the push',
|
||||
},
|
||||
after: {
|
||||
type: 'string',
|
||||
description: 'SHA of the commit after the push',
|
||||
},
|
||||
created: {
|
||||
type: 'boolean',
|
||||
description: 'Whether this push created a new branch or tag',
|
||||
},
|
||||
deleted: {
|
||||
type: 'boolean',
|
||||
description: 'Whether this push deleted a branch or tag',
|
||||
},
|
||||
forced: {
|
||||
type: 'boolean',
|
||||
description: 'Whether this was a force push',
|
||||
},
|
||||
base_ref: {
|
||||
type: 'string',
|
||||
description: 'Base reference for the push',
|
||||
},
|
||||
compare: {
|
||||
type: 'string',
|
||||
description: 'URL to compare the changes',
|
||||
},
|
||||
commits: {
|
||||
type: 'array',
|
||||
description: 'Array of commit objects included in this push',
|
||||
items: {
|
||||
id: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA',
|
||||
},
|
||||
tree_id: {
|
||||
type: 'string',
|
||||
description: 'Git tree SHA',
|
||||
},
|
||||
distinct: {
|
||||
type: 'boolean',
|
||||
description: 'Whether this commit is distinct from others in the push',
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
description: 'Commit message',
|
||||
},
|
||||
timestamp: {
|
||||
type: 'string',
|
||||
description: 'Commit timestamp',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Commit URL',
|
||||
},
|
||||
author: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Author name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Author email',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
description: 'Author GitHub username',
|
||||
},
|
||||
},
|
||||
committer: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Committer name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Committer email',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
description: 'Committer GitHub username',
|
||||
},
|
||||
},
|
||||
added: {
|
||||
type: 'array',
|
||||
description: 'Array of file paths added in this commit',
|
||||
},
|
||||
removed: {
|
||||
type: 'array',
|
||||
description: 'Array of file paths removed in this commit',
|
||||
},
|
||||
modified: {
|
||||
type: 'array',
|
||||
description: 'Array of file paths modified in this commit',
|
||||
},
|
||||
},
|
||||
},
|
||||
head_commit: {
|
||||
id: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA of the most recent commit',
|
||||
},
|
||||
tree_id: {
|
||||
type: 'string',
|
||||
description: 'Git tree SHA',
|
||||
},
|
||||
distinct: {
|
||||
type: 'boolean',
|
||||
description: 'Whether this commit is distinct',
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
description: 'Commit message',
|
||||
},
|
||||
timestamp: {
|
||||
type: 'string',
|
||||
description: 'Commit timestamp',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Commit URL',
|
||||
},
|
||||
author: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Author name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Author email',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
description: 'Author GitHub username',
|
||||
},
|
||||
},
|
||||
committer: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Committer name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Committer email',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
description: 'Committer GitHub username',
|
||||
},
|
||||
},
|
||||
added: {
|
||||
type: 'array',
|
||||
description: 'Array of file paths added in this commit',
|
||||
},
|
||||
removed: {
|
||||
type: 'array',
|
||||
description: 'Array of file paths removed in this commit',
|
||||
},
|
||||
modified: {
|
||||
type: 'array',
|
||||
description: 'Array of file paths modified in this commit',
|
||||
},
|
||||
},
|
||||
pusher: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Pusher name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Pusher email',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Owner node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'push',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,731 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubReleasePublishedTrigger: TriggerConfig = {
|
||||
id: 'github_release_published',
|
||||
name: 'GitHub Release Published',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow when a new release is published in a GitHub repository',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_release_published',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_release_published',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_release_published',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_release_published',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>Releases</strong> event.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_release_published',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., release)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Action performed (published, unpublished, created, edited, deleted, prereleased, released)',
|
||||
},
|
||||
release: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Release ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Release node ID',
|
||||
},
|
||||
tag_name: {
|
||||
type: 'string',
|
||||
description: 'Git tag name for the release',
|
||||
},
|
||||
target_commitish: {
|
||||
type: 'string',
|
||||
description: 'Target branch or commit SHA',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Release name/title',
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
description: 'Release description/notes in markdown format',
|
||||
},
|
||||
draft: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the release is a draft',
|
||||
},
|
||||
prerelease: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the release is a pre-release',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Release creation timestamp',
|
||||
},
|
||||
published_at: {
|
||||
type: 'string',
|
||||
description: 'Release publication timestamp',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Release API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Release HTML URL',
|
||||
},
|
||||
assets_url: {
|
||||
type: 'string',
|
||||
description: 'Release assets API URL',
|
||||
},
|
||||
upload_url: {
|
||||
type: 'string',
|
||||
description: 'URL for uploading release assets',
|
||||
},
|
||||
tarball_url: {
|
||||
type: 'string',
|
||||
description: 'Source code tarball download URL',
|
||||
},
|
||||
zipball_url: {
|
||||
type: 'string',
|
||||
description: 'Source code zipball download URL',
|
||||
},
|
||||
discussion_url: {
|
||||
type: 'string',
|
||||
description: 'Discussion URL if available',
|
||||
},
|
||||
author: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
gravatar_id: {
|
||||
type: 'string',
|
||||
description: 'Gravatar ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'User API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
followers_url: {
|
||||
type: 'string',
|
||||
description: 'Followers API URL',
|
||||
},
|
||||
following_url: {
|
||||
type: 'string',
|
||||
description: 'Following API URL',
|
||||
},
|
||||
gists_url: {
|
||||
type: 'string',
|
||||
description: 'Gists API URL',
|
||||
},
|
||||
starred_url: {
|
||||
type: 'string',
|
||||
description: 'Starred repositories API URL',
|
||||
},
|
||||
subscriptions_url: {
|
||||
type: 'string',
|
||||
description: 'Subscriptions API URL',
|
||||
},
|
||||
organizations_url: {
|
||||
type: 'string',
|
||||
description: 'Organizations API URL',
|
||||
},
|
||||
repos_url: {
|
||||
type: 'string',
|
||||
description: 'Repositories API URL',
|
||||
},
|
||||
events_url: {
|
||||
type: 'string',
|
||||
description: 'Events API URL',
|
||||
},
|
||||
received_events_url: {
|
||||
type: 'string',
|
||||
description: 'Received events API URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
site_admin: {
|
||||
type: 'boolean',
|
||||
description: 'Whether user is a site administrator',
|
||||
},
|
||||
},
|
||||
assets: {
|
||||
type: 'array',
|
||||
description: 'Array of release asset objects with download URLs',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
archive_url: {
|
||||
type: 'string',
|
||||
description: 'Archive API URL',
|
||||
},
|
||||
assignees_url: {
|
||||
type: 'string',
|
||||
description: 'Assignees API URL',
|
||||
},
|
||||
blobs_url: {
|
||||
type: 'string',
|
||||
description: 'Blobs API URL',
|
||||
},
|
||||
branches_url: {
|
||||
type: 'string',
|
||||
description: 'Branches API URL',
|
||||
},
|
||||
collaborators_url: {
|
||||
type: 'string',
|
||||
description: 'Collaborators API URL',
|
||||
},
|
||||
comments_url: {
|
||||
type: 'string',
|
||||
description: 'Comments API URL',
|
||||
},
|
||||
commits_url: {
|
||||
type: 'string',
|
||||
description: 'Commits API URL',
|
||||
},
|
||||
compare_url: {
|
||||
type: 'string',
|
||||
description: 'Compare API URL',
|
||||
},
|
||||
contents_url: {
|
||||
type: 'string',
|
||||
description: 'Contents API URL',
|
||||
},
|
||||
contributors_url: {
|
||||
type: 'string',
|
||||
description: 'Contributors API URL',
|
||||
},
|
||||
deployments_url: {
|
||||
type: 'string',
|
||||
description: 'Deployments API URL',
|
||||
},
|
||||
downloads_url: {
|
||||
type: 'string',
|
||||
description: 'Downloads API URL',
|
||||
},
|
||||
events_url: {
|
||||
type: 'string',
|
||||
description: 'Events API URL',
|
||||
},
|
||||
forks_url: {
|
||||
type: 'string',
|
||||
description: 'Forks API URL',
|
||||
},
|
||||
git_commits_url: {
|
||||
type: 'string',
|
||||
description: 'Git commits API URL',
|
||||
},
|
||||
git_refs_url: {
|
||||
type: 'string',
|
||||
description: 'Git refs API URL',
|
||||
},
|
||||
git_tags_url: {
|
||||
type: 'string',
|
||||
description: 'Git tags API URL',
|
||||
},
|
||||
hooks_url: {
|
||||
type: 'string',
|
||||
description: 'Hooks API URL',
|
||||
},
|
||||
issue_comment_url: {
|
||||
type: 'string',
|
||||
description: 'Issue comment API URL',
|
||||
},
|
||||
issue_events_url: {
|
||||
type: 'string',
|
||||
description: 'Issue events API URL',
|
||||
},
|
||||
issues_url: {
|
||||
type: 'string',
|
||||
description: 'Issues API URL',
|
||||
},
|
||||
keys_url: {
|
||||
type: 'string',
|
||||
description: 'Keys API URL',
|
||||
},
|
||||
labels_url: {
|
||||
type: 'string',
|
||||
description: 'Labels API URL',
|
||||
},
|
||||
languages_url: {
|
||||
type: 'string',
|
||||
description: 'Languages API URL',
|
||||
},
|
||||
merges_url: {
|
||||
type: 'string',
|
||||
description: 'Merges API URL',
|
||||
},
|
||||
milestones_url: {
|
||||
type: 'string',
|
||||
description: 'Milestones API URL',
|
||||
},
|
||||
notifications_url: {
|
||||
type: 'string',
|
||||
description: 'Notifications API URL',
|
||||
},
|
||||
pulls_url: {
|
||||
type: 'string',
|
||||
description: 'Pull requests API URL',
|
||||
},
|
||||
releases_url: {
|
||||
type: 'string',
|
||||
description: 'Releases API URL',
|
||||
},
|
||||
stargazers_url: {
|
||||
type: 'string',
|
||||
description: 'Stargazers API URL',
|
||||
},
|
||||
statuses_url: {
|
||||
type: 'string',
|
||||
description: 'Statuses API URL',
|
||||
},
|
||||
subscribers_url: {
|
||||
type: 'string',
|
||||
description: 'Subscribers API URL',
|
||||
},
|
||||
subscription_url: {
|
||||
type: 'string',
|
||||
description: 'Subscription API URL',
|
||||
},
|
||||
tags_url: {
|
||||
type: 'string',
|
||||
description: 'Tags API URL',
|
||||
},
|
||||
teams_url: {
|
||||
type: 'string',
|
||||
description: 'Teams API URL',
|
||||
},
|
||||
trees_url: {
|
||||
type: 'string',
|
||||
description: 'Trees API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
has_issues: {
|
||||
type: 'boolean',
|
||||
description: 'Whether issues are enabled',
|
||||
},
|
||||
has_projects: {
|
||||
type: 'boolean',
|
||||
description: 'Whether projects are enabled',
|
||||
},
|
||||
has_downloads: {
|
||||
type: 'boolean',
|
||||
description: 'Whether downloads are enabled',
|
||||
},
|
||||
has_wiki: {
|
||||
type: 'boolean',
|
||||
description: 'Whether wiki is enabled',
|
||||
},
|
||||
has_pages: {
|
||||
type: 'boolean',
|
||||
description: 'Whether GitHub Pages is enabled',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
mirror_url: {
|
||||
type: 'string',
|
||||
description: 'Mirror URL if repository is a mirror',
|
||||
},
|
||||
archived: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is archived',
|
||||
},
|
||||
disabled: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is disabled',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
license: {
|
||||
key: {
|
||||
type: 'string',
|
||||
description: 'License key',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'License name',
|
||||
},
|
||||
spdx_id: {
|
||||
type: 'string',
|
||||
description: 'SPDX license identifier',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'License API URL',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'License node ID',
|
||||
},
|
||||
},
|
||||
allow_forking: {
|
||||
type: 'boolean',
|
||||
description: 'Whether forking is allowed',
|
||||
},
|
||||
is_template: {
|
||||
type: 'boolean',
|
||||
description: 'Whether repository is a template',
|
||||
},
|
||||
topics: {
|
||||
type: 'array',
|
||||
description: 'Array of repository topics',
|
||||
},
|
||||
visibility: {
|
||||
type: 'string',
|
||||
description: 'Repository visibility (public, private, internal)',
|
||||
},
|
||||
forks: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
watchers: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Repository creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Repository last update timestamp',
|
||||
},
|
||||
pushed_at: {
|
||||
type: 'string',
|
||||
description: 'Repository last push timestamp',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Owner node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
gravatar_id: {
|
||||
type: 'string',
|
||||
description: 'Owner gravatar ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Owner API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
followers_url: {
|
||||
type: 'string',
|
||||
description: 'Followers API URL',
|
||||
},
|
||||
following_url: {
|
||||
type: 'string',
|
||||
description: 'Following API URL',
|
||||
},
|
||||
gists_url: {
|
||||
type: 'string',
|
||||
description: 'Gists API URL',
|
||||
},
|
||||
starred_url: {
|
||||
type: 'string',
|
||||
description: 'Starred repositories API URL',
|
||||
},
|
||||
subscriptions_url: {
|
||||
type: 'string',
|
||||
description: 'Subscriptions API URL',
|
||||
},
|
||||
organizations_url: {
|
||||
type: 'string',
|
||||
description: 'Organizations API URL',
|
||||
},
|
||||
repos_url: {
|
||||
type: 'string',
|
||||
description: 'Repositories API URL',
|
||||
},
|
||||
events_url: {
|
||||
type: 'string',
|
||||
description: 'Events API URL',
|
||||
},
|
||||
received_events_url: {
|
||||
type: 'string',
|
||||
description: 'Received events API URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
site_admin: {
|
||||
type: 'boolean',
|
||||
description: 'Whether owner is a site administrator',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
gravatar_id: {
|
||||
type: 'string',
|
||||
description: 'Gravatar ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'User API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
followers_url: {
|
||||
type: 'string',
|
||||
description: 'Followers API URL',
|
||||
},
|
||||
following_url: {
|
||||
type: 'string',
|
||||
description: 'Following API URL',
|
||||
},
|
||||
gists_url: {
|
||||
type: 'string',
|
||||
description: 'Gists API URL',
|
||||
},
|
||||
starred_url: {
|
||||
type: 'string',
|
||||
description: 'Starred repositories API URL',
|
||||
},
|
||||
subscriptions_url: {
|
||||
type: 'string',
|
||||
description: 'Subscriptions API URL',
|
||||
},
|
||||
organizations_url: {
|
||||
type: 'string',
|
||||
description: 'Organizations API URL',
|
||||
},
|
||||
repos_url: {
|
||||
type: 'string',
|
||||
description: 'Repositories API URL',
|
||||
},
|
||||
events_url: {
|
||||
type: 'string',
|
||||
description: 'Events API URL',
|
||||
},
|
||||
received_events_url: {
|
||||
type: 'string',
|
||||
description: 'Received events API URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
site_admin: {
|
||||
type: 'boolean',
|
||||
description: 'Whether user is a site administrator',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'release',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
import { isRecordLike } from '@sim/utils/object'
|
||||
|
||||
/**
|
||||
* Shared repository output schema
|
||||
*/
|
||||
export const repositoryOutputs = {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size in KB',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
},
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Shared sender/user output schema
|
||||
*/
|
||||
export const userOutputs = {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Checks whether a delivered GitHub event matches the expected trigger
|
||||
* configuration, used for event filtering in the webhook processor.
|
||||
*
|
||||
* GitHub fires `issue_comment` for comments on both issues and pull
|
||||
* requests, and `pull_request` with action `closed` for both a merge and a
|
||||
* close-without-merge; the `validator` entries disambiguate those cases via
|
||||
* `issue.pull_request` (present only on PR comments) and
|
||||
* `pull_request.merged` respectively.
|
||||
*/
|
||||
export function isGitHubEventMatch(
|
||||
triggerId: string,
|
||||
eventType: string,
|
||||
action?: string,
|
||||
payload?: unknown
|
||||
): boolean {
|
||||
const eventMap: Record<
|
||||
string,
|
||||
{
|
||||
event: string
|
||||
actions?: string[]
|
||||
validator?: (payload: Record<string, unknown>) => boolean
|
||||
}
|
||||
> = {
|
||||
github_issue_opened: { event: 'issues', actions: ['opened'] },
|
||||
github_issue_closed: { event: 'issues', actions: ['closed'] },
|
||||
github_issue_comment: {
|
||||
event: 'issue_comment',
|
||||
validator: (p) => !isRecordLike(p.issue) || !p.issue.pull_request,
|
||||
},
|
||||
github_pr_opened: { event: 'pull_request', actions: ['opened'] },
|
||||
github_pr_closed: {
|
||||
event: 'pull_request',
|
||||
actions: ['closed'],
|
||||
validator: (p) => isRecordLike(p.pull_request) && p.pull_request.merged === false,
|
||||
},
|
||||
github_pr_merged: {
|
||||
event: 'pull_request',
|
||||
actions: ['closed'],
|
||||
validator: (p) => isRecordLike(p.pull_request) && p.pull_request.merged === true,
|
||||
},
|
||||
github_pr_comment: {
|
||||
event: 'issue_comment',
|
||||
validator: (p) => isRecordLike(p.issue) && !!p.issue.pull_request,
|
||||
},
|
||||
github_pr_reviewed: { event: 'pull_request_review', actions: ['submitted'] },
|
||||
github_push: { event: 'push' },
|
||||
github_release_published: { event: 'release', actions: ['published'] },
|
||||
github_workflow_run: { event: 'workflow_run' },
|
||||
}
|
||||
|
||||
const config = eventMap[triggerId]
|
||||
if (!config) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (config.event !== eventType) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (config.actions && action && !config.actions.includes(action)) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (config.validator) {
|
||||
return config.validator(isRecordLike(payload) ? payload : {})
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -0,0 +1,533 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubWebhookTrigger: TriggerConfig = {
|
||||
id: 'github_webhook',
|
||||
name: 'GitHub Webhook',
|
||||
provider: 'github',
|
||||
description: 'Trigger workflow from GitHub events like push, pull requests, issues, and more',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_webhook',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{ label: 'application/x-www-form-urlencoded', id: 'application/x-www-form-urlencoded' },
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_webhook',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_webhook',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_webhook',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Choose which events should trigger this webhook.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_webhook',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
ref: {
|
||||
type: 'string',
|
||||
description: 'Git reference (e.g., refs/heads/fix/telegram-wh)',
|
||||
},
|
||||
before: {
|
||||
type: 'string',
|
||||
description: 'SHA of the commit before the push',
|
||||
},
|
||||
after: {
|
||||
type: 'string',
|
||||
description: 'SHA of the commit after the push',
|
||||
},
|
||||
created: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the push created the reference',
|
||||
},
|
||||
deleted: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the push deleted the reference',
|
||||
},
|
||||
forced: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the push was forced',
|
||||
},
|
||||
base_ref: {
|
||||
type: 'string',
|
||||
description: 'Base reference for the push',
|
||||
},
|
||||
compare: {
|
||||
type: 'string',
|
||||
description: 'URL to compare the changes',
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
fork: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is a fork',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Repository API URL',
|
||||
},
|
||||
created_at: {
|
||||
type: 'number',
|
||||
description: 'Repository creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Repository last updated time',
|
||||
},
|
||||
pushed_at: {
|
||||
type: 'number',
|
||||
description: 'Repository last push timestamp',
|
||||
},
|
||||
git_url: {
|
||||
type: 'string',
|
||||
description: 'Repository git URL',
|
||||
},
|
||||
ssh_url: {
|
||||
type: 'string',
|
||||
description: 'Repository SSH URL',
|
||||
},
|
||||
clone_url: {
|
||||
type: 'string',
|
||||
description: 'Repository clone URL',
|
||||
},
|
||||
homepage: {
|
||||
type: 'string',
|
||||
description: 'Repository homepage URL',
|
||||
},
|
||||
size: {
|
||||
type: 'number',
|
||||
description: 'Repository size',
|
||||
},
|
||||
stargazers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of stars',
|
||||
},
|
||||
watchers_count: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
description: 'Primary programming language',
|
||||
},
|
||||
forks_count: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
archived: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is archived',
|
||||
},
|
||||
disabled: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is disabled',
|
||||
},
|
||||
open_issues_count: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
topics: {
|
||||
type: 'array',
|
||||
description: 'Repository topics',
|
||||
},
|
||||
visibility: {
|
||||
type: 'string',
|
||||
description: 'Repository visibility (public, private)',
|
||||
},
|
||||
forks: {
|
||||
type: 'number',
|
||||
description: 'Number of forks',
|
||||
},
|
||||
open_issues: {
|
||||
type: 'number',
|
||||
description: 'Number of open issues',
|
||||
},
|
||||
watchers: {
|
||||
type: 'number',
|
||||
description: 'Number of watchers',
|
||||
},
|
||||
default_branch: {
|
||||
type: 'string',
|
||||
description: 'Default branch name',
|
||||
},
|
||||
stargazers: {
|
||||
type: 'number',
|
||||
description: 'Number of stargazers',
|
||||
},
|
||||
master_branch: {
|
||||
type: 'string',
|
||||
description: 'Master branch name',
|
||||
},
|
||||
owner: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Owner name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Owner email',
|
||||
},
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Owner node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
gravatar_id: {
|
||||
type: 'string',
|
||||
description: 'Owner gravatar ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Owner API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
user_view_type: {
|
||||
type: 'string',
|
||||
description: 'User view type',
|
||||
},
|
||||
site_admin: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the owner is a site admin',
|
||||
},
|
||||
},
|
||||
license: {
|
||||
type: 'object',
|
||||
description: 'Repository license information',
|
||||
key: {
|
||||
type: 'string',
|
||||
description: 'License key (e.g., apache-2.0)',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'License name',
|
||||
},
|
||||
spdx_id: {
|
||||
type: 'string',
|
||||
description: 'SPDX license identifier',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'License URL',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'License node ID',
|
||||
},
|
||||
},
|
||||
},
|
||||
pusher: {
|
||||
type: 'object',
|
||||
description: 'Information about who pushed the changes',
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Pusher name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Pusher email',
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Sender username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Sender ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Sender node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Sender avatar URL',
|
||||
},
|
||||
gravatar_id: {
|
||||
type: 'string',
|
||||
description: 'Sender gravatar ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Sender API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Sender profile URL',
|
||||
},
|
||||
user_view_type: {
|
||||
type: 'string',
|
||||
description: 'User view type',
|
||||
},
|
||||
site_admin: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the sender is a site admin',
|
||||
},
|
||||
},
|
||||
commits: {
|
||||
type: 'array',
|
||||
description: 'Array of commit objects',
|
||||
id: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA',
|
||||
},
|
||||
tree_id: {
|
||||
type: 'string',
|
||||
description: 'Tree SHA',
|
||||
},
|
||||
distinct: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the commit is distinct',
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
description: 'Commit message',
|
||||
},
|
||||
timestamp: {
|
||||
type: 'string',
|
||||
description: 'Commit timestamp',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Commit URL',
|
||||
},
|
||||
author: {
|
||||
type: 'object',
|
||||
description: 'Commit author',
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Author name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Author email',
|
||||
},
|
||||
},
|
||||
committer: {
|
||||
type: 'object',
|
||||
description: 'Commit committer',
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Committer name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Committer email',
|
||||
},
|
||||
},
|
||||
added: {
|
||||
type: 'array',
|
||||
description: 'Array of added files',
|
||||
},
|
||||
removed: {
|
||||
type: 'array',
|
||||
description: 'Array of removed files',
|
||||
},
|
||||
modified: {
|
||||
type: 'array',
|
||||
description: 'Array of modified files',
|
||||
},
|
||||
},
|
||||
head_commit: {
|
||||
type: 'object',
|
||||
description: 'Head commit object',
|
||||
id: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA',
|
||||
},
|
||||
tree_id: {
|
||||
type: 'string',
|
||||
description: 'Tree SHA',
|
||||
},
|
||||
distinct: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the commit is distinct',
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
description: 'Commit message',
|
||||
},
|
||||
timestamp: {
|
||||
type: 'string',
|
||||
description: 'Commit timestamp',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Commit URL',
|
||||
},
|
||||
author: {
|
||||
type: 'object',
|
||||
description: 'Commit author',
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Author name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Author email',
|
||||
},
|
||||
},
|
||||
committer: {
|
||||
type: 'object',
|
||||
description: 'Commit committer',
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Committer name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Committer email',
|
||||
},
|
||||
},
|
||||
added: {
|
||||
type: 'array',
|
||||
description: 'Array of added files',
|
||||
},
|
||||
removed: {
|
||||
type: 'array',
|
||||
description: 'Array of removed files',
|
||||
},
|
||||
modified: {
|
||||
type: 'array',
|
||||
description: 'Array of modified files',
|
||||
},
|
||||
},
|
||||
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'Type of GitHub event (e.g., push, pull_request, issues)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'The action that was performed (e.g., opened, closed, synchronize)',
|
||||
},
|
||||
branch: {
|
||||
type: 'string',
|
||||
description: 'Branch name extracted from ref',
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'pull_request',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,476 @@
|
||||
import { GithubIcon } from '@/components/icons'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const githubWorkflowRunTrigger: TriggerConfig = {
|
||||
id: 'github_workflow_run',
|
||||
name: 'GitHub Actions Workflow Run',
|
||||
provider: 'github',
|
||||
description:
|
||||
'Trigger workflow when a GitHub Actions workflow run is requested, in progress, or completed',
|
||||
version: '1.0.0',
|
||||
icon: GithubIcon,
|
||||
|
||||
subBlocks: [
|
||||
{
|
||||
id: 'webhookUrlDisplay',
|
||||
title: 'Webhook URL',
|
||||
type: 'short-input',
|
||||
readOnly: true,
|
||||
showCopyButton: true,
|
||||
useWebhookUrl: true,
|
||||
placeholder: 'Webhook URL will be generated',
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_workflow_run',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
title: 'Content Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'application/json', id: 'application/json' },
|
||||
{
|
||||
label: 'application/x-www-form-urlencoded',
|
||||
id: 'application/x-www-form-urlencoded',
|
||||
},
|
||||
],
|
||||
defaultValue: 'application/json',
|
||||
description: 'Format GitHub will use when sending the webhook payload.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_workflow_run',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'webhookSecret',
|
||||
title: 'Webhook Secret',
|
||||
type: 'short-input',
|
||||
placeholder: 'Generate or enter a strong secret',
|
||||
description: 'Validates that webhook deliveries originate from GitHub.',
|
||||
password: true,
|
||||
required: false,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_workflow_run',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sslVerification',
|
||||
title: 'SSL Verification',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Enabled', id: 'enabled' },
|
||||
{ label: 'Disabled', id: 'disabled' },
|
||||
],
|
||||
defaultValue: 'enabled',
|
||||
description: 'GitHub verifies SSL certificates when delivering webhooks.',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_workflow_run',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: [
|
||||
'Go to your GitHub Repository > Settings > Webhooks.',
|
||||
'Click "Add webhook".',
|
||||
'Paste the <strong>Webhook URL</strong> above into the "Payload URL" field.',
|
||||
'Select your chosen Content Type from the dropdown.',
|
||||
'Enter the <strong>Webhook Secret</strong> into the "Secret" field if you\'ve configured one.',
|
||||
'Set SSL verification according to your selection.',
|
||||
'Select "Let me select individual events" and check <strong>Workflow runs</strong>.',
|
||||
'Ensure "Active" is checked and click "Add webhook".',
|
||||
]
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join(''),
|
||||
mode: 'trigger',
|
||||
condition: {
|
||||
field: 'selectedTriggerId',
|
||||
value: 'github_workflow_run',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
outputs: {
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'GitHub event type from X-GitHub-Event header (e.g., workflow_run)',
|
||||
},
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'Action performed (requested, in_progress, completed)',
|
||||
},
|
||||
workflow_run: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Workflow run ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Workflow run node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Workflow name',
|
||||
},
|
||||
workflow_id: {
|
||||
type: 'number',
|
||||
description: 'Workflow ID',
|
||||
},
|
||||
run_number: {
|
||||
type: 'number',
|
||||
description: 'Run number for this workflow',
|
||||
},
|
||||
run_attempt: {
|
||||
type: 'number',
|
||||
description: 'Attempt number for this run',
|
||||
},
|
||||
event: {
|
||||
type: 'string',
|
||||
description: 'Event that triggered the workflow (push, pull_request, etc.)',
|
||||
},
|
||||
status: {
|
||||
type: 'string',
|
||||
description: 'Current status (queued, in_progress, completed)',
|
||||
},
|
||||
conclusion: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Conclusion (success, failure, cancelled, skipped, timed_out, action_required)',
|
||||
},
|
||||
head_branch: {
|
||||
type: 'string',
|
||||
description: 'Branch name',
|
||||
},
|
||||
head_sha: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA that triggered the workflow',
|
||||
},
|
||||
path: {
|
||||
type: 'string',
|
||||
description: 'Path to the workflow file',
|
||||
},
|
||||
display_title: {
|
||||
type: 'string',
|
||||
description: 'Display title for the run',
|
||||
},
|
||||
run_started_at: {
|
||||
type: 'string',
|
||||
description: 'Timestamp when the run started',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Workflow run creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Workflow run last update timestamp',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Workflow run HTML URL',
|
||||
},
|
||||
check_suite_id: {
|
||||
type: 'number',
|
||||
description: 'Associated check suite ID',
|
||||
},
|
||||
check_suite_node_id: {
|
||||
type: 'string',
|
||||
description: 'Associated check suite node ID',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Workflow run API URL',
|
||||
},
|
||||
actor: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
triggering_actor: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether repository is private',
|
||||
},
|
||||
},
|
||||
head_repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Head repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Head repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Head repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Head repository full name',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether repository is private',
|
||||
},
|
||||
},
|
||||
head_commit: {
|
||||
id: {
|
||||
type: 'string',
|
||||
description: 'Commit SHA',
|
||||
},
|
||||
tree_id: {
|
||||
type: 'string',
|
||||
description: 'Tree ID',
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
description: 'Commit message',
|
||||
},
|
||||
timestamp: {
|
||||
type: 'string',
|
||||
description: 'Commit timestamp',
|
||||
},
|
||||
author: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Author name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Author email',
|
||||
},
|
||||
},
|
||||
committer: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Committer name',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Committer email',
|
||||
},
|
||||
},
|
||||
},
|
||||
pull_requests: {
|
||||
type: 'array',
|
||||
description: 'Array of associated pull requests',
|
||||
},
|
||||
referenced_workflows: {
|
||||
type: 'array',
|
||||
description: 'Array of referenced workflow runs',
|
||||
},
|
||||
},
|
||||
workflow: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Workflow ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Workflow node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Workflow name',
|
||||
},
|
||||
path: {
|
||||
type: 'string',
|
||||
description: 'Path to workflow file',
|
||||
},
|
||||
state: {
|
||||
type: 'string',
|
||||
description: 'Workflow state (active, deleted, disabled_fork, etc.)',
|
||||
},
|
||||
created_at: {
|
||||
type: 'string',
|
||||
description: 'Workflow creation timestamp',
|
||||
},
|
||||
updated_at: {
|
||||
type: 'string',
|
||||
description: 'Workflow last update timestamp',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'Workflow API URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Workflow HTML URL',
|
||||
},
|
||||
badge_url: {
|
||||
type: 'string',
|
||||
description: 'Workflow badge URL',
|
||||
},
|
||||
},
|
||||
repository: {
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Repository ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Repository node ID',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Repository name',
|
||||
},
|
||||
full_name: {
|
||||
type: 'string',
|
||||
description: 'Repository full name (owner/repo)',
|
||||
},
|
||||
private: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the repository is private',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Repository HTML URL',
|
||||
},
|
||||
repo_description: {
|
||||
type: 'string',
|
||||
description: 'Repository description',
|
||||
},
|
||||
owner: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Owner username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'Owner ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'Owner node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Owner avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Owner profile URL',
|
||||
},
|
||||
owner_type: {
|
||||
type: 'string',
|
||||
description: 'Owner type (User, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
login: {
|
||||
type: 'string',
|
||||
description: 'Username',
|
||||
},
|
||||
id: {
|
||||
type: 'number',
|
||||
description: 'User ID',
|
||||
},
|
||||
node_id: {
|
||||
type: 'string',
|
||||
description: 'User node ID',
|
||||
},
|
||||
avatar_url: {
|
||||
type: 'string',
|
||||
description: 'Avatar URL',
|
||||
},
|
||||
html_url: {
|
||||
type: 'string',
|
||||
description: 'Profile URL',
|
||||
},
|
||||
user_type: {
|
||||
type: 'string',
|
||||
description: 'User type (User, Bot, Organization)',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-GitHub-Event': 'workflow_run',
|
||||
'X-GitHub-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
'X-Hub-Signature-256': 'sha256=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user