Skip to content

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. The latest_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

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

Screenshot_2024-05-19_at_10.29.03_PM

How to set up and validate locally

  1. Create a badge with the given URL for Link and Badge Image URL: https://cpfi.cp.co.id/images/svg/%{latest_tag}.svg
  2. Go to the project's homepage. The badge will shown as Project's badge
  3. Create a new tag with the name facebook
  4. Refresh the project homepage. You will see a new badge as shown in the screenshot.
Edited by Tamsil Sajid Amani

Merge request reports