Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link on badge when using GH Action Summary #492

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pchalamet
Copy link

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
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
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 !

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.

2 participants