Remarque
Workflow badges in a private repository are not accessible externally, so you won't be able to embed them or link to them from an external site.
Un badge d’état indique si un workflow est en train d’échouer ou de réussir. En règle générale, vous ajoutez un badge d’état dans le fichier README.md
de votre dépôt, mais vous pouvez l’ajouter dans n’importe quelle page web de votre choix. Par défaut, les badges affichent l’état de votre branche par défaut. Si aucun flux de travail n’est exécuté sur votre branche par défaut, ils affichent l’état de l’exécution la plus récente sur toutes les branches. Vous pouvez afficher l’état d’une exécution de workflow pour une branche ou un événement spécifique en utilisant les paramètres de requête branch
et event
dans l’URL.
To add a workflow status badge to your README.md
file, first find the URL for the status badge you would like to display. Then you can use Markdown to display the badge as an image in your README.md
file. For more information about image markup in Markdown, see Syntaxe de base pour l’écriture et la mise en forme.
Using the UI
You can create a workflow status badge directly on the UI using the workflow file name, branch parameter, and event parameter.
-
Sur GitHub, accédez à la page principale du référentiel.
-
Sous le nom de votre dépôt, cliquez sur Actions.
-
Dans la barre latérale gauche, cliquez sur le workflow que vous souhaitez afficher.
-
On the right side of the page, next to the "Filter workflow runs" field, click to display a dropdown menu and click Create status badge.
-
Optionally, select a branch if you want to display the status badge for a branch different from the default branch.
-
Optionally, select the event that will trigger the workflow.
-
Click Copy status badge Markdown.
-
Copy the Markdown into your
README.md
file.
Using the workflow file name
You can build the URL for a workflow status badge using the name of the workflow file:
https://github.com/OWNER/REPOSITORY/actions/workflows/WORKFLOW-FILE/badge.svg
To display the workflow status badge in your README.md
file, use the Markdown markup for embedding images. For more information about image markup in Markdown, see Syntaxe de base pour l’écriture et la mise en forme.
For example, add the following Markdown to your README.md
file to add a status badge for a workflow with the file path .github/workflows/main.yml
. The OWNER
of the repository is the github
organization and the REPOSITORY
name is docs
.

Using the branch
parameter
To display the status of a workflow run for a specific branch, add ?branch=BRANCH-NAME
to the end of the status badge URL.
For example, add the following Markdown to your README.md
file to display a status badge for a branch with the name feature-1
.

Using the event
parameter
To display the status of workflow runs triggered by the push
event, add ?event=push
to the end of the status badge URL.
For example, add the following Markdown to your README.md
file to display a badge with the status of workflow runs triggered by the push
event, which will show the status of the build for the current state of that branch.
