Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit c650673

Browse files
authored
PR stop script
1 parent 0247792 commit c650673

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed
File renamed without changes.

scripts/pr_stop.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import argparse
2+
import re
3+
from subprocess import Popen
4+
5+
6+
def get_args():
7+
parser = argparse.ArgumentParser()
8+
parser.add_argument('--repo-url', type=str, required=True)
9+
parser.add_argument('--git-ref', type=str, required=True)
10+
return parser.parse_args()
11+
12+
13+
if __name__ == "__main__":
14+
args = get_args()
15+
_, org, repo = args.repo_url.rsplit('/', 2)
16+
pr_num = re.match("^refs/pull/(?P<pr_num>\d+)", args.git_ref).group('pr_num')
17+
Popen(['docker', 'rm', '-f', f'pkff_dev__{repo}__pr{pr_num}']).communicate()

scripts/test.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)