GitHubBadges allows the embedding and customization of GitHub Actions workflow badges into Fandom. One can customize which repository and which workflow the badge is monitoring, with its branch and event parameters exposed.
Installation
- Add the script to your wiki's ImportJS:
- Create a
{{GitHub Badge}}template:
Usage
GitHubBadges exposes some parameters for the user to customize:
repo- The repository name of the workflow, e.g.
github/actions. workflow- Which workflow file on the repository to display its status. They are located in the .github/workflows directory of a repository. For example:
close-stale.yml,unittests.yml. branch(optional)- Which branch of the repository should the badge get its status. In cases where you would like to get the status of, say, the
devbranch instead of the defaultmainormaster. event(optional)- Which workflow event to observe. They can be seen here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows.
Examples
- Raw HTML usage
<div class="gh-badge" data-gh-repository="microsoft/vscode" data-gh-workflow="monaco-editor.yml" data-gh-event="push"></div>
- Basic usage
{{GitHub Badge|repo=Wikitubia/information|workflow=fetchstats.yml}}
- With branch parameter
{{GitHub Badge|repo=raspberrypi/linux|workflow=kunit.yml|branch=rpi-6.1.y}}
- With everything
{{GitHub Badge|repo=openssl/openssl|workflow=windows.yml|branch=openssl-3.2|event=push}}
Text above can be found here (edit)