There is an amazing service shields.io that produces github status badges. In particular, it can retrieve shield configuration from another API. This piece of code implements such API endpoint for extracting abap package version.
The service is available at shield.abap.space
domain. In order to add a badge to your repository add the following line at the top of your root readme file.
![abap package version](https://img.shields.io/endpoint?url=https://shield.abap.space/version-shield-json/$TYPE/$OWNER/$REPO/$PATH/$CONSTANT_NAME)
where:
'X.Y.Z'
or 'vX.Y.Z'
or 'vX.Y.Z-beta'
- the version string is validated and a wrongly formatted one will not pass (e.g. 'X.Y'
is not valid)$PATH
= .apack-manifest.xml
the version is read directly from that file.'...apack-manifest.xml/dependencies/<group_id>/<artifact_id>'
.begin of...
) are also supportedShields.io allows to override some of parameters e.g. label and color - see more in their documentation. For example: https://img.shields.io/endpoint?url=...&label=version&color=red
to display the shield in red and with shorter "version" label instead of "abap package version".
N.B. Please report bugs if found :)
Interactive badge constructor is available at this repository github page