Skip to content

Commit

Permalink
feat(github): list repository collaborators
Browse files Browse the repository at this point in the history
  • Loading branch information
wollefitz committed Mar 4, 2024
1 parent b9b8c92 commit 8f42f02
Showing 1 changed file with 136 additions and 5 deletions.
141 changes: 136 additions & 5 deletions connectors/github/element-templates/github-connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
{
"name": "Pulls",
"value": "pulls"
},
{
"name": "Collaborators",
"value": "collaborators"
}
],
"binding": {
Expand Down Expand Up @@ -350,6 +354,29 @@
"name": "operationType"
}
},
{
"label": "Operation type",
"id": "operationType",
"group": "operation",
"type": "Dropdown",
"value": "listCollaborators",
"choices": [
{
"name": "List repository collaborators",
"value": "listCollaborators"
}
],
"condition": {
"property": "operationGroup",
"oneOf": [
"collaborators"
]
},
"binding": {
"type": "zeebe:input",
"name": "operationType"
}
},
{
"type": "Hidden",
"label": "Type",
Expand Down Expand Up @@ -460,7 +487,8 @@
"listAlertsForOrg",
"searchIssues",
"getIssue",
"listCommits"
"listCommits",
"listCollaborators"
]
}
},
Expand Down Expand Up @@ -500,7 +528,8 @@
"listCommits",
"createWorkflowDispatchEvent",
"createReference",
"createPullRequest"
"createPullRequest",
"listCollaborators"
]
}
},
Expand Down Expand Up @@ -540,7 +569,8 @@
"listCommits",
"createWorkflowDispatchEvent",
"createReference",
"createPullRequest"
"createPullRequest",
"listCollaborators"
]
}
},
Expand Down Expand Up @@ -1318,7 +1348,7 @@
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^refs\\/[^\\/]+\\/[^\\/]*",
"value": "^(=.+|refs\\/[^\\/]+\\/[^\\/]*)",
"message": "must be a fully qualified reference (i.e: refs/heads/main) starting with \"refs\" and containing at least two slashes."
}
},
Expand Down Expand Up @@ -1438,6 +1468,7 @@
"description": "Indicates whether the pull request is a draft",
"group": "input",
"type": "Boolean",
"feel": "optional",
"binding": {
"type": "zeebe:input",
"name": "draft"
Expand All @@ -1449,6 +1480,58 @@
]
}
},
{
"label": "Include anonymous contributors",
"group": "input",
"type": "Boolean",
"feel": "optional",
"binding": {
"type": "zeebe:input",
"name": "anon"
},
"condition": {
"property": "operationType",
"oneOf": [
"listCollaborators"
]
}
},
{
"label": "Page",
"description": "The page number of the results to fetch. Default: 1",
"group": "input",
"type": "Number",
"feel": "optional",
"value": "1",
"binding": {
"type": "zeebe:input",
"name": "page"
},
"condition": {
"property": "operationType",
"oneOf": [
"listCollaborators"
]
}
},
{
"label": "Results per page",
"description": "The number of results to include per page. Default: 30",
"group": "input",
"type": "Number",
"feel": "optional",
"value": "30",
"binding": {
"type": "zeebe:input",
"name": "per_page"
},
"condition": {
"property": "operationType",
"oneOf": [
"listCollaborators"
]
}
},
{
"group": "configuration",
"type": "Hidden",
Expand Down Expand Up @@ -1579,7 +1662,7 @@
{
"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}",
"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\": if draft = null then null else draft}",
"binding": {
"type": "zeebe:input",
"name": "body"
Expand Down Expand Up @@ -1622,6 +1705,21 @@
]
}
},
{
"group": "input",
"type": "Hidden",
"value": "={\"anon\": if anon = null then null else anon, \"per_page\": if per_page = null then null else per_page, \"page\": if page = null then null else page}",
"binding": {
"type": "zeebe:input",
"name": "queryParameters"
},
"condition": {
"property": "operationType",
"oneOf": [
"listCollaborators"
]
}
},
{
"label": "Result variable",
"description": "Name of variable to store the response in. Details in the <a href=\"https://docs.camunda.io/docs/components/connectors/use-connectors/#result-variable\" target=\"_blank\">documentation</a>",
Expand Down Expand Up @@ -1955,6 +2053,25 @@
]
}
},
{
"label": "Result expression",
"id": "resultExpressionListCollaborators",
"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": "={collaboratorsList: response.body}",
"binding": {
"type": "zeebe:taskHeader",
"key": "resultExpression"
},
"condition": {
"property": "operationType",
"oneOf": [
"listCollaborators"
]
}
},
{
"label": "Connection timeout",
"description": "Sets the timeout in seconds to establish a connection or 0 for an infinite timeout",
Expand Down Expand Up @@ -2269,6 +2386,20 @@
]
}
},
{
"type": "Hidden",
"value": "=baseUrl + \"/repos/\" + owner + \"/\" + repo + \"/collaborators\"",
"binding": {
"type": "zeebe:input",
"name": "url"
},
"condition": {
"property": "operationType",
"oneOf": [
"listCollaborators"
]
}
},
{
"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 8f42f02

Please sign in to comment.