@@ -35,22 +35,24 @@ class Check:
3535 run : Callable [[], int ] # Function that runs the check, returns exit code
3636
3737
38- def write_github_summary (check : Check , check_key : str , output : str ) -> None :
38+ def write_github_summary (check : Check , check_key : str ) -> None :
3939 """Write failure summary to GITHUB_STEP_SUMMARY if in CI."""
4040 summary_file = os .environ .get ("GITHUB_STEP_SUMMARY" )
4141 if not summary_file :
4242 return
4343
44- # Truncate output if too long
45- max_output = 2000
46- if len (output ) > max_output :
47- output = output [:max_output ] + "\n ... (truncated)"
44+ # Build link to job logs
45+ server = os .environ .get ("GITHUB_SERVER_URL" , "https://github.com" )
46+ repo = os .environ .get ("GITHUB_REPOSITORY" , "" )
47+ run_id = os .environ .get ("GITHUB_RUN_ID" , "" )
48+ log_link = f"{ server } /{ repo } /actions/runs/{ run_id } " if repo else ""
4849
4950 with open (summary_file , "a" ) as f :
5051 f .write (f"## ❌ { check .name } failed\n \n " )
51- f .write ("```\n " )
52- f .write (output )
53- f .write ("\n ```\n \n " )
52+ if log_link :
53+ f .write (f"[See full log output]({ log_link } )\n \n " )
54+ else :
55+ f .write ("See log output above.\n \n " )
5456 f .write ("### How to fix\n \n " )
5557 f .write (check .fix_hint )
5658 f .write ("\n \n " )
@@ -331,7 +333,7 @@ def main() -> None:
331333 print ("\n Run all static checks: tox -e check\n " , file = sys .stderr )
332334 # For changelog, we already built the output message
333335 if args .check != "changelog" :
334- write_github_summary (check , args .check , "See check output above" )
336+ write_github_summary (check , args .check )
335337
336338 sys .exit (exit_code )
337339
0 commit comments