Skip to main content

Adding a workflow status badge

You can display a status badge in your repository to indicate the status of your workflows.

Hinweis

Auf GitHub gehostete Runner werden aktuell nicht auf GitHub Enterprise Server unterstützt. Weitere Informationen zur geplanten zukünftigen Unterstützung findest Du in der GitHub public roadmap.

Hinweis

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.

Ein Statusbadge zeigt an, ob ein Workflow derzeit fehlerhaft oder korrekt ausgeführt wird. Ein gängiger Ort für ein Statusbadge ist die Datei README.md deines Repositorys, du kannst den Badge aber zu jeder beliebigen Webseite hinzufügen. Standardmäßig zeigen Badges den Status deines Standardbranchs an. Wenn in Ihrem Standardbranch kein Workflow ausgeführt wird, wird der Status der letzten Ausführung über alle Branches hinweg angezeigt. Sie können den Status einer Workflowausführung für einen bestimmten Branch oder ein bestimmtes Ereignis anzeigen, indem Sie die Abfrageparameter branch und event in der URL verwenden.

Screenshot eines Workflowstatus-Badges In der Reihenfolge von rechts nach links wird angezeigt: das GitHub-Logo, der Workflowname („GitHub Actions Demo“) und der Status („passing“).

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 Grundlegende Schreib- und Formatierungssyntax.

Using the UI

You can create a workflow status badge directly on the UI using the workflow file name, branch parameter, and event parameter.

  1. Navigieren Sie auf GitHub zur Hauptseite des Repositorys.

  2. Klicke unter dem Namen deines Repositorys auf Aktionen.

    Screenshot: Registerkarten für das Repository „github/docs“. Die Registerkarte „Aktionen“ ist mit einem orangefarbenen Rahmen hervorgehoben.

  3. Klicke in der linken Seitenleiste auf den Workflow, den Du sehen willst.

    Screenshot der linken Randleiste der Registerkarte „Aktionen“. Ein Workflow, „CodeQL“, ist dunkelorange umrandet.

  4. 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.

  5. Optionally, select a branch if you want to display the status badge for a branch different from the default branch.

  6. Optionally, select the event that will trigger the workflow.

  7. Click Copy status badge Markdown.

  8. 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:

HOSTNAME/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 Grundlegende Schreib- und Formatierungssyntax.

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.

![example workflow](http://github.com/github/docs/actions/workflows/main.yml/badge.svg)

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.

![example branch parameter](http://github.com/github/docs/actions/workflows/main.yml/badge.svg?branch=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.

![example event parameter](http://github.com/github/docs/actions/workflows/main.yml/badge.svg?event=push)