Skip to content

Add link on badge when using GH Action Summary#492

Open
pchalamet wants to merge 2 commits intodorny:mainfrom
MagnusOpera:link
Open

Add link on badge when using GH Action Summary#492
pchalamet wants to merge 2 commits intodorny:mainfrom
MagnusOpera:link

Conversation

@pchalamet
Copy link
Copy Markdown

Problem

As of now, clicking on the badge on GH Action Summary:
image

goes to nowhere interesting (https://camo.githubusercontent.com/xxx).

This PR

This (completely unsolicited) PR introduces a new feature: the badge is now in an anchor, and when clicked, this open the collapsed section and goes to the top of the tests report. At least, I can click roughly on a bigger thing than a small collapsed section 🤷‍♂️

image

Next

Nothing fancy, I just like it this way 🤷‍♂️ Hope you like it too! Thanks for this gh action btw.

@jozefizso
Copy link
Copy Markdown
Collaborator

Hi @pchalamet, thanks for this contribution. I like this change.

How would it work if there are multiple Workflow test summaries in an action?

I think a unique ID should be added to the anchor label.

@jozefizso jozefizso self-assigned this Aug 30, 2024
@jozefizso jozefizso added the enhancement New feature or request label Aug 30, 2024
@pchalamet
Copy link
Copy Markdown
Author

Yes you are right as on my project (link to a GH build - check the first summary output link: https://github.com/MagnusOpera/Terrabuild/actions/runs/10595006592) I add to do this for my own summary output (the first one). As I obviously only use one single test report, it's ok (for me !).

Anyway, probably this would require a more broad fix as link navigation is non-functional in test report summary as of now. It seems to me, that anchors in markdown in summary do not work correctly unless prefix with #user-content. For my own summary output, I mangled all anchor this way: [{node.Label}](#user-content-{uniqueId}). I hope you will understand why I've used #user-content-test-report in this PR as well.

I can of course add a random uuid in this PR, but I would suggest to fix all anchors in another PR. Well, let me know !

@micmarc
Copy link
Copy Markdown
Contributor

micmarc commented Mar 29, 2025

@pchalamet FYI, anchors have been fixed (I believe) in #567

@jozefizso
Copy link
Copy Markdown
Collaborator

Hi @pchalamet, thanks for this contribution.

Does this PR #588 fixes the links?

@jozefizso jozefizso self-requested a review July 9, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants