From 469a026cb7172265169b161382d52548d48a54d8 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 16 Mar 2021 17:17:20 +0100 Subject: [PATCH] batcave: get zodbot to announce commits on the master branch of the dns git repo Signed-off-by: Pierre-Yves Chibon --- roles/batcave/files/zodbot-announce-commits.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/batcave/files/zodbot-announce-commits.py b/roles/batcave/files/zodbot-announce-commits.py index e869252e14..51893e1671 100644 --- a/roles/batcave/files/zodbot-announce-commits.py +++ b/roles/batcave/files/zodbot-announce-commits.py @@ -5,6 +5,7 @@ # But when it breaks, don't yell at him because that's mean. # update hook for FI repos -> zodbot. +import os import sys import subprocess import shlex @@ -116,7 +117,8 @@ def parse_commit(commit): # Get a list of commits to report. -if branch == 'main': +cwd = os.getcwd() +if (cwd.endswith('dns') and branch == 'master') or branch == 'main': revs = run_command(f"git rev-list ^{old} {new}")["stdout"].split("\n") revs = [r for r in revs if r] revs.reverse()