Does Github support username variable in Readme.md?
Asked Answered
L

1

7

I have a repository which contains a badge from Travis-CI. This badge is included in the Readme.md with the following link, as suggested by Travis-CI documentation:

[![Build Status](https://travis-ci.org/nikicc/orange3-text.svg?branch=master)](https://travis-ci.org/nikicc/orange3-text)

However, now everyone that forks my repo will got the links to my Travis-CI badge, since it is hardcoded along with my username. I would like to achieve that all forks automatically have the links to theirs badges, not mine. Is it possible to somehow bypass this by using some variable for the username of the repository inside Readme.md files on Github? Is there any nice solution for this?

Labrie answered 5/9, 2015 at 0:0 Comment(3)
#18674194Denby
github.com/travis-ci/travis-ci/issues/779Denby
Seems like there is no solution for now :(Labrie
A
0

There is an alternative way to make it work:

Github: Can I see the number of downloads for a repo?

(https://github.com/andry81-devops/github-accum-stats)

It can be adopted the same way for an external service or site with data. All you need is to write a shell or any other script and call it from the github workflow action (.github/workflows/blabla.yml file).

The only thing can be a problem here is the GitHub workflow pipline call frequency, which might has a limit something about 1 call per 1 hour or 15 minutes (I didn't test it).

The idea is the same - store the status in a separate repository and does update it from a GitHub workflow action. Later you can use another action to rewrite the statistic repository below the head commit to cut off the history of changes if not need it.

Alvinia answered 17/12, 2021 at 4:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.