Creating an adapter registration for GitHub provider
Before GitHub and Enterprise Marketplace can communicate, you must create an adapter registration in GitHub using these steps:
Enter these parameters:
Service:
consume_common_api
Scroll down to the
Client Management API
section.
Run the POST /emp/common/clients API to create a new subscriber with the following payload:
{
"name":"order_fulfillment_github",
"provider_code":"github",
"applicable_for":[
{
"id":"integration",
"values":[
"OrderFulfillment"
],
"workflowId":"",
"eventType":""
}
],
"callback":{
"url":"github.kyndryl.net/api/v3/repos/MCMP-Marketplace/gcs-content-template",
"certs":{
"endpoint_ca_cer":"",
"endpoint_cer":"",
"endpoint_key":""
},
"headers":{
},
"connection_protocol":"https"
}
Curl command:
curl -X 'POST' \ '<BASE_HOST_URL>/consume/emp/common/clients' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <bearer token>' \ -d '{ "name":"order_fulfillment_github", "provider_code":"github", "applicable_for":[ { "id":"integration", "values":[ "OrderFulfillment" ], "workflowId":"", "eventType":"" } ], "callback":{ "url":"github.kyndryl.net/api/v3/repos/MCMP-Marketplace/gcs-content-template", "certs":{ "endpoint_ca_cer":"", "endpoint_cer":"", "endpoint_key":"" }, "headers":{ }, "connection_protocol":"https" } }'
Note the following about the payload:
values:
OrderFulfillment.
eventType:
Required if user wants to trigger repository dispatch on GitHub Action. The following payload will be received by GitHub for repository dispatch:
{
"event_type": "value of eventType",
"client_payload": {
"empOrderPayload": order details in json format
}
}
workflowId:
The ID of the workflow. You can also pass the workflow file name as a string. Required if user wants to trigger workflow dispatch on GitHub Action. The following payload will be received by GitHub for workflow dispatch:
{
"ref": "GitHub branchname",
"inputs": {
"empOrderPayload": order details in stringify json format
}
If both
eventType
and
workflowId
are empty/null then values from applicable_for will be used as
eventType
to trigger repository dispatch GitHub Action. If both fields have values, then repository dispatch will be triggered by using
eventType
.