- Use gitlab private repositories for code and add https://gitlab.com/manu_j as collaborator. Email [email protected] once finished.
- You can use a webhook testing platform instead of slack but it should follow the slack webhook payload format.
Create a ruby web application, which accepts webhook requests from github.
- When a label is added to an issue, send a notification to a slack channel.
- The slack webhook URL should be provided to the app as an environment variable - SLACK_WEBHOOK_URL .
- Set the username of slack webhook as your email.
- The notification should be “Label xxxx was added to issue 201”. The issue number should be a link to the github issue.
- Add tests and use the gitlab CI to test
- Dockerize the application
{
"action": "new_label",
"controller": "api\/v1\/git_label",
"git_label": {
"action": "unlabeled",
"issue": {
"url": "https:\/\/api.github.com\/repos\/Gaurav2728\/shoping\/issues\/1",
"repository_url": "https:\/\/api.github.com\/repos\/Gaurav2728\/shoping",
"labels_url": "https:\/\/api.github.com\/repos\/Gaurav2728\/shoping\/issues\/1\/labels{\/name}",
"id": 384074233,
"node_id": "MDU6SXNzdWUzODQwNzQyMzM=",
"number": 1,
"title": "githubhook test issue",
"user": {
"login": "Gaurav2728",
"id": 1284716,
"node_id": "MDQ6VXNlcjEyODQ3MTY=",
"received_events_url": "https:\/\/api.github.com\/users\/Gaurav2728\/received_events",
"type": "User",
"site_admin": false
},
"labels": [
{
"id": 21254536,
"node_id": "MDU6TGFiZWwyMTI1NDUzNg==",
"url": "https:\/\/api.github.com\/repos\/Gaurav2728\/shoping\/labels\/invalid",
"name": "invalid",
"color": "e6e6e6",
"default": true
}
],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [
],
"milestone": null,
"body": ""
},
"label": {
"id": 21254535,
"node_id": "MDU6TGFiZWwyMTI1NDUzNQ==",
"url": "https:\/\/api.github.com\/repos\/Gaurav2728\/shoping\/labels\/enhancement",
"name": "enhancement",
"color": "84b6eb",
"default": true
}
}
}
https://github.com/Gaurav2728/shoping/
https://gaurav.requestcatcher.com/
Output
{"text":"Label 'question' added to issue","url":"https://github.com/Gaurav2728/shoping/issues/1"}
{"text":"Label 'duplicate' removed to issue","url":"https://github.com/Gaurav2728/shoping/issues/1"}
https://ruby-rockers.slack.com/ Channel - test
Output
Label
duplicate
removed to issue.