@@ -41,15 +41,27 @@ def compare_files_str(file1, file2):
4141 return ret
4242
4343
44- def comment_pr (folder1 , folder2 , output_file , repo , pr_number , run_id ):
44+ def comment_pr (output_file , repo , run_id ):
45+ folder1 = "out_base"
46+ folder2 = "out_merge"
47+ utils .subprocess_run (["gh" , "run" , "download" , "--repo" , repo , "--name" ,
48+ "csv-framework-coverage-base" , "--dir" , folder1 , str (run_id )])
49+ utils .subprocess_run (["gh" , "run" , "download" , "--repo" , repo , "--name" ,
50+ "csv-framework-coverage-merge" , "--dir" , folder2 , str (run_id )])
51+ utils .subprocess_run (["gh" , "run" , "download" , "--repo" , repo , "--name" ,
52+ "pr" , "--dir" , "pr" , str (run_id )])
53+
54+ with open ("pr/NR" ) as file :
55+ pr_number = int (file .read ())
56+
4557 compare_folders (folder1 , folder2 , output_file )
4658 size = os .path .getsize (output_file )
4759 if size == 0 :
4860 print ("No difference in the coverage reports" )
4961 return
5062
5163 comment = ":warning: The head of this PR and the base branch were compared for differences in the framework coverage reports. " + \
52- "The generated reports are available in the [artifacts of this workflow run](https://github.com/" + repo + "/actions/runs/" + run_id + "). " + \
64+ "The generated reports are available in the [artifacts of this workflow run](https://github.com/" + repo + "/actions/runs/" + str ( run_id ) + "). " + \
5365 "The differences will be picked up by the nightly job after the PR gets merged. "
5466
5567 if size < 2000 :
@@ -62,7 +74,7 @@ def comment_pr(folder1, folder2, output_file, repo, pr_number, run_id):
6274 comment += "The differences can be found in the " + \
6375 output_file + " artifact of this job."
6476
65- post_comment (comment , repo , pr_number )
77+ # post_comment(comment, repo, pr_number)
6678
6779
6880def post_comment (comment , repo , pr_number ):
@@ -125,5 +137,5 @@ def compare_folders(folder1, folder2, output_file):
125137 out .write (return_md )
126138
127139
128- comment_pr (sys .argv [1 ], sys .argv [2 ], sys .argv [3 ],
129- sys . argv [ 4 ], sys . argv [ 5 ], sys . argv [ 6 ] )
140+ # comment_pr(sys.argv[1], sys.argv[2], sys.argv[3])
141+ comment_pr ( "x.md" , "dsp-testing/codeql-csv-coverage-pr-commenter" , 938931471 )
0 commit comments