Enable `latest_tag` as a valid badge token
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do and why?
-
The following MR adds
latest_tag
as an additional token that can be used when creating a badge. Thelatest_tag
will be replaced by the value of the last tag which is added to the project. This will be helpful when a user wants to fetch an attribute from a URL, to add a badge, without manually changing the URL every time. -
Some specs have also been refactored making them easier to read and comprehend
Issue: #26420 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
- Create a badge with the given URL for
Link
andBadge Image URL
:https://cpfi.cp.co.id/images/svg/%{latest_tag}.svg
- Go to the project's homepage. The badge will shown as
Project's badge
- Create a new tag with the name
facebook
- Refresh the project homepage. You will see a new badge as shown in the screenshot.
Edited by Tamsil Sajid Amani