From edcfb9344e9204315e2e44f2a531eac0141c7db5 Mon Sep 17 00:00:00 2001 From: licihua Date: Mon, 28 Mar 2022 09:37:34 +0800 Subject: [PATCH] add repo name in title --- advisors/check_missing_file.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/advisors/check_missing_file.py b/advisors/check_missing_file.py index 1060c00b..aec1e333 100755 --- a/advisors/check_missing_file.py +++ b/advisors/check_missing_file.py @@ -97,8 +97,8 @@ def main_process(repo, push, check_file): if push: issues = my_gitee.get_issues(repo) for issue in issues: - if issue["title"] == "Submit {file} file into this repository".format( - file=check_file): + if "Submit {file} file into this repository".format( + file=check_file) in issue["title"]: need_push_issue = False ages = datetime.now() - my_gitee.get_gitee_datetime(issue["created_at"]) if ages.days <= 10: @@ -112,16 +112,20 @@ def main_process(repo, push, check_file): if need_push_issue: if check_file == 'spec': my_gitee.post_issue(repo, - "Submit {file} file into this repository".format( - file=check_file), + "Submit {file} file into this repository: {repo}".format( + file=check_file, + repo=repo), NEW_SPEC_ISSUE_BODY.format(repo=repo, file=check_file)) - else: + elif my_gitee.get_spec(repo): my_gitee.post_issue(repo, - "Submit {file} file into this repository".format( - file=check_file), + "Submit {file} file into this repository: {repo}".format( + file=check_file, + repo=repo), NEW_YMAL_ISSUE_BODY.format(repo=repo, file=check_file)) + else: + print("No spec file find in repo {}".format(repo)) return 'NOK' return 'OK' -- Gitee