Following the video introduction tutorial, I loved the idea to know who stars our OSS repositories, and especially who unstars, so I can follow-up and figure out why!
This workflow is very similar to the tutorial, with a slightly better Slack message.
Potential improvements:
- Ideally, I’d prefer to watch over all public repositories automatically instead of adding them one by one. But I don’t know if that’s possible.
- Display the country the user is from, because that’s nice to know people from all over the world use your work! But this information isn’t part of the payload and it feels like I’d need to make another call before sending the Slack message.
Workflow:
Summary
{
"name": "Watch GitHub OSS stars",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
980,
160
]
},
{
"parameters": {
"owner": "UnlyEd",
"repository": "next-right-now",
"events": [
"star"
]
},
"name": "Github Trigger",
"type": "n8n-nodes-base.githubTrigger",
"typeVersion": 1,
"position": [
770,
100
],
"webhookId": "7ec26c00-f410-49e2-ae52-a788c71b0829",
"credentials": {
"githubApi": "Vadorequest"
}
},
{
"parameters": {
"channel": "oss-github-stars",
"attachments": [
{
"title_link": "={{$json[\"body\"][\"repository\"][\"html_url\"]}}",
"title": "={{$json[\"body\"][\"repository\"][\"full_name\"]}}",
"color": "#48F20A",
"image_url": "={{$json[\"body\"][\"sender\"][\"avatar_url\"]}}",
"text": "=Got star from <{{$json[\"body\"][\"sender\"][\"html_url\"]}}|{{$json[\"body\"][\"sender\"][\"login\"]}}> ({{$json[\"body\"][\"repository\"][\"stargazers_count\"] -1}} > {{$json[\"body\"][\"repository\"][\"stargazers_count\"]}})"
}
],
"otherOptions": {}
},
"name": "Slack2",
"type": "n8n-nodes-base.slack",
"typeVersion": 1,
"position": [
1200,
320
],
"retryOnFail": false,
"notesInFlow": true,
"credentials": {
"slackApi": "Unly"
},
"color": "#48F20A",
"notes": "Got star"
}
],
"connections": {
"Github Trigger": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "Slack2",
"type": "main",
"index": 0
}
],
[
{
"node": "Slack1",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {},
"id": "1"
}