Created
December 4, 2022 22:28
-
-
Save NoNews/bdedf2560c92ecea2867d1c9084321f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
parser = argparse.ArgumentParser("") | |
parser.add_argument('--target-branch', required=True) | |
args = parser.parse_args() | |
command = "git diff {target_branch} --name-status".format(target_branch=args.target_branch) | |
diffs = os.popen(command).read() | |
for current_file in diffs.splitlines(): | |
operation = current_file[0] | |
current_file_name = str(current_file)[1:].strip() | |
if current_file_name.startswith("app_name/app/src/") and operation == 'A': | |
os.system("echo \"##teamcity[buildStatus text='Adding new files to app module is restricted']\"") | |
raise Exception("Adding new files to app module is restricted") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment