Skip to content

Commit ec891ba

Browse files
zaniebzaniebot
andauthored
Link the commit in pull request report footers (astral-sh#29621)
The report footer renders the commit SHA as code, so it is not clickable. Link the commit, label it as the revision the results describe, and separate the footer from the report. --------- Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
1 parent 8958748 commit ec891ba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎scripts/publish_pr_report.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,13 @@ def render_report(
171171
contents = (
172172
f"{contents.rstrip()}\n\n[Download the full report (ZIP)]({report_url})"
173173
)
174+
commit_url = f"https://github.com/{REPOSITORY}/commit/{run['head_sha']}"
174175
run_url = f"https://github.com/{REPOSITORY}/actions/runs/{run['id']}/attempts/{run['run_attempt']}"
175176
return (
176177
f"{report_marker(report)}\n"
177178
f"<!-- report-run:{run['id']}:{run['run_attempt']} -->\n\n"
178-
f"{contents.rstrip()}\n\n"
179-
f"[Workflow run]({run_url}) · `{run['head_sha'][:7]}`\n"
179+
f"{contents.rstrip()}\n\n---\n\n"
180+
f"Results for [{run['head_sha'][:7]}]({commit_url}) · [Workflow run]({run_url})\n"
180181
)
181182

182183

0 commit comments

Comments
 (0)