'What are the accessible variables in the README.md file of a Github repo?
I have quite a lot of 'hardcoded' pieces of information in the README of my Github repo.
- The user name : instead of my username, can I put something like $USER (whatever the syntax is) ? I have some links, badges, that contain the user name. That causes issues when doing forks and then the same issue the other way around when doing pull requests.
- The latest release : instead of hardcoding the latest release number in the readme, is it possible to use an existing variable ? In my particular case, I want to put a link to the latest release available on jitpack.io. It looks like https://jitpack.io/com/github/somebody/somerepo/something/2.0/something-2.0.zip
Solution 1:[1]
There are no variables in a README. A README is just a normal Markdown (or AsciiDoc, etc.) document that happens to be rendered on the main page of the repository instead of requiring that the user browse to it directly.
It may be that for the jitpack.io URL, there's a special latest version URL that you can use, but you'd have to check their documentation. I'm not personally aware of one. You could of course host a server that performs the correct redirects to your badges and release assets automatically (or proxies them), but there's no way to modify the README to make it anything other than a static document.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bk2204 |
