@sashko - we’re* working on a bot-engine for Material-UI. It listens for github webhooks, and takes configuration as code that can be as simple as:
{
description: 'Label new issue as "Triage"',
event: 'issues',
conditions: { 'action': 'opened' },
requests: {
method: 'POST',
path: '/repos/:owner/:repo/issues/:number/labels',
body: ['Triage']
}
},
Or as sophisticated as:
{
description: 'Mark pull requests with merge conflicts as "PR: Needs Rebase" when master is updated',
event: 'push',
conditions: {
'ref': 'refs/heads/master'
},
requests: (eventObj, githubRequest) => {
const fullName = eventObj.payload.repository.full_name;
return new Promise(resolve => setTimeout(() => resolve(), 5000))
.then(() => githubRequest({
path: '/search/issues',
payload: eventObj.payload,
query: {
q: [
`repo:${fullName}`,
'is:open',
'type:pr',
'-label:"PR: Needs Rebase"'
].join(' ')
}
}))
.then(response => response && response.items ? response.items : [])
.then(pullRequests => Promise.all(
pullRequests.map(pr => (
githubRequest({
path: `/repos/${fullName}/pulls/${pr.number}`
})
))
))
.then(pullRequests => pullRequests.filter(pr => pr.mergeable === false))
.then(pullRequests => Promise.all(
pullRequests.map(pr => (
githubRequest({
method: 'POST',
path: `/repos/${fullName}/issues/${pr.number}/labels`,
body: ['PR: Needs Rebase']
})
))
));
}
}
The nice thing about this is you have complete flexibility to do anything the github API supports.
It’s getting there, but slowly - everyone who works on Material-UI core team (and that’s only a handful of us) does so on their own time, and this project is lower down the priority stack, but it’s getting there.
I’ll post back when we go live and the code & docs are in a publicly usable state.
Edit: When I say ‘we’, the original concept was mine, but @nathanmarks has done all the hard work.