summaryrefslogtreecommitdiffstats
path: root/.github/scripts
diff options
context:
space:
mode:
authornkozlovskiy <[email protected]>2023-10-11 13:26:26 +0300
committernkozlovskiy <[email protected]>2023-10-11 14:26:39 +0300
commit42f0675f6f18e31185186d600373f740f2e4a0b7 (patch)
tree58aee98736e5afd80071f696ec8c318e796a82d5 /.github/scripts
parent1d645bbaca687855582cc1808b4f4508dfc6ba3f (diff)
PR from branch users/nkozlovskiy/github-pr-history-link
fix runid wip
Diffstat (limited to '.github/scripts')
-rwxr-xr-x.github/scripts/tests/generate-summary.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/.github/scripts/tests/generate-summary.py b/.github/scripts/tests/generate-summary.py
index 6cd3db8aaa0..9f218f55e86 100755
--- a/.github/scripts/tests/generate-summary.py
+++ b/.github/scripts/tests/generate-summary.py
@@ -268,7 +268,7 @@ def gen_summary(summary_url_prefix, summary_out_folder, paths):
return summary
-def update_pr_comment(pr: PullRequest, summary: TestSummary):
+def update_pr_comment(pr: PullRequest, summary: TestSummary, test_history_url: str):
header = f"<!-- status {pr.number} -->"
if summary.is_failed:
@@ -278,6 +278,10 @@ def update_pr_comment(pr: PullRequest, summary: TestSummary):
body = [header, f"{result} for commit {pr.head.sha}."]
+ if test_history_url:
+ body.append("")
+ body.append(f"[Test history]({test_history_url})")
+
body.extend(summary.render())
body = "\n".join(body)
@@ -299,6 +303,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("--summary-out-path", required=True)
parser.add_argument("--summary-url-prefix", required=True)
+ parser.add_argument('--test-history-url', required=False)
parser.add_argument("args", nargs="+", metavar="TITLE html_out path")
args = parser.parse_args()
@@ -319,7 +324,7 @@ def main():
event = json.load(fp)
pr = gh.create_from_raw_data(PullRequest, event["pull_request"])
- update_pr_comment(pr, summary)
+ update_pr_comment(pr, summary, args.test_history_url)
if __name__ == "__main__":