nikicc
nikicc

Reputation: 638

Does Github support username variable in Readme.md?

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?

Upvotes: 7

Views: 1857

Answers (1)

Andry
Andry

Reputation: 2727

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.

Upvotes: 0

Related Questions