Skip to content

Commit

Permalink
feat(github): create pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
wollefitz committed Mar 4, 2024
1 parent 02f6f84 commit b9b8c92
Showing 1 changed file with 198 additions and 3 deletions.
201 changes: 198 additions & 3 deletions connectors/github/element-templates/github-connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
{
"name": "References",
"value": "references"
},
{
"name": "Pulls",
"value": "pulls"
}
],
"binding": {
Expand Down Expand Up @@ -323,6 +327,29 @@
"name": "operationType"
}
},
{
"label": "Operation type",
"id": "operationType",
"group": "operation",
"type": "Dropdown",
"value": "createPullRequest",
"choices": [
{
"name": "Create a pull request",
"value": "createPullRequest"
}
],
"condition": {
"property": "operationGroup",
"oneOf": [
"pulls"
]
},
"binding": {
"type": "zeebe:input",
"name": "operationType"
}
},
{
"type": "Hidden",
"label": "Type",
Expand Down Expand Up @@ -371,7 +398,8 @@
"orgInvitation",
"createIssueComment",
"createWorkflowDispatchEvent",
"createReference"
"createReference",
"createPullRequest"
]
}
},
Expand Down Expand Up @@ -471,7 +499,8 @@
"listAlertsForRepo",
"listCommits",
"createWorkflowDispatchEvent",
"createReference"
"createReference",
"createPullRequest"
]
}
},
Expand Down Expand Up @@ -510,7 +539,8 @@
"listAlertsForRepo",
"listCommits",
"createWorkflowDispatchEvent",
"createReference"
"createReference",
"createPullRequest"
]
}
},
Expand Down Expand Up @@ -1322,6 +1352,103 @@
]
}
},
{
"label": "Title",
"description": "The title of the new pull request",
"group": "input",
"type": "String",
"feel": "optional",
"value": "",
"binding": {
"type": "zeebe:input",
"name": "title"
},
"constraints": {
"notEmpty": true
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"label": "Head",
"description": "The name of the branch where your changes are implemented",
"group": "input",
"type": "String",
"feel": "optional",
"value": "",
"binding": {
"type": "zeebe:input",
"name": "head"
},
"constraints": {
"notEmpty": true
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"label": "Base",
"description": "The name of the branch you want the changes pulled into",
"group": "input",
"type": "String",
"feel": "optional",
"value": "",
"binding": {
"type": "zeebe:input",
"name": "base"
},
"constraints": {
"notEmpty": true
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"label": "Body",
"description": "The contents of the pull request",
"group": "input",
"type": "String",
"feel": "optional",
"value": "",
"binding": {
"type": "zeebe:input",
"name": "prBody"
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"label": "Draft",
"description": "Indicates whether the pull request is a draft",
"group": "input",
"type": "Boolean",
"binding": {
"type": "zeebe:input",
"name": "draft"
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"group": "configuration",
"type": "Hidden",
Expand Down Expand Up @@ -1449,6 +1576,22 @@
},
"optional": true
},
{
"group": "input",
"type": "Hidden",
"value": "={\"title\": if title = null then null else title, \"head\": if head = null then null else head, \"base\": if base = null then null else base, \"body\": if prBody = null then null else prBody, \"draft\": draft}",
"binding": {
"type": "zeebe:input",
"name": "body"
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
},
"optional": true
},
{
"group": "input",
"type": "Hidden",
Expand Down Expand Up @@ -1774,6 +1917,44 @@
]
}
},
{
"label": "Result expression",
"id": "resultCreateReference",
"description": "Expression to map the response into process variables. Details in the <a href=\"https://docs.camunda.io/docs/components/connectors/use-connectors/#result-expression\" target=\"_blank\">documentation</a>",
"group": "output",
"type": "String",
"feel": "required",
"value": "={createdReference: response.body}",
"binding": {
"type": "zeebe:taskHeader",
"key": "resultExpression"
},
"condition": {
"property": "operationType",
"oneOf": [
"createReference"
]
}
},
{
"label": "Result expression",
"id": "resultCreatePullRequest",
"description": "Expression to map the response into process variables. Details in the <a href=\"https://docs.camunda.io/docs/components/connectors/use-connectors/#result-expression\" target=\"_blank\">documentation</a>",
"group": "output",
"type": "String",
"feel": "required",
"value": "={createdPullRequest: response.body}",
"binding": {
"type": "zeebe:taskHeader",
"key": "resultExpression"
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"label": "Connection timeout",
"description": "Sets the timeout in seconds to establish a connection or 0 for an infinite timeout",
Expand Down Expand Up @@ -2074,6 +2255,20 @@
]
}
},
{
"type": "Hidden",
"value": "=baseUrl + \"/repos/\" + owner + \"/\" + repo + \"/pulls\"",
"binding": {
"type": "zeebe:input",
"name": "url"
},
"condition": {
"property": "operationType",
"oneOf": [
"createPullRequest"
]
}
},
{
"label": "Error expression",
"description": "Expression to handle errors. Details in the <a href=\"https://docs.camunda.io/docs/components/connectors/use-connectors/#bpmn-errors\" target=\"_blank\">documentation</a>",
Expand Down

0 comments on commit b9b8c92

Please sign in to comment.