mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot_merge: only label PR if not created merged/closed
Would generate a ton of GH API churn when synchronising.
This commit is contained in:
parent
39a0d723af
commit
47428a4580
@ -559,12 +559,13 @@ class PullRequests(models.Model):
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
pr = super().create(vals)
|
||||
self.env['runbot_merge.pull_requests.tagging'].create({
|
||||
'pull_request': pr.number,
|
||||
'repository': pr.repository.id,
|
||||
'state_from': False,
|
||||
'state_to': pr._tagstate,
|
||||
})
|
||||
if pr.state not in ('closed', 'merged'):
|
||||
self.env['runbot_merge.pull_requests.tagging'].create({
|
||||
'pull_request': pr.number,
|
||||
'repository': pr.repository.id,
|
||||
'state_from': False,
|
||||
'state_to': pr._tagstate,
|
||||
})
|
||||
return pr
|
||||
|
||||
@api.multi
|
||||
|
Loading…
Reference in New Issue
Block a user