1
0
mirror of synced 2025-12-23 11:54:18 -05:00
Files
docs/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md
Nick Schonning d9167f1449 chore: Add missing code fence languages (#772)
* chore: Add missing code fence languages

* Update content/actions/creating-actions/dockerfile-support-for-github-actions.md

* Add raw & endraw markers around shell content

See review comment by @rachmari

* Add raw & endraw markers around shell content

See review comment by @rachmari

* Remove language from code fences

to avoid the problem of replaceable text indicates like
<this> not showing up in the output page.

Co-authored-by: hubwriter <hubwriter@github.com>
2021-01-18 12:04:46 +00:00

64 lines
2.5 KiB
Markdown

---
title: Adding a workflow status badge
intro: You can display a status badge in your repository to indicate the status of your workflows.
product: '{% data reusables.gated-features.actions %}'
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
---
{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
{% data reusables.repositories.actions-workflow-status-badge-into %}
If your workflow uses the `name` keyword, you must reference the workflow by name. If the name of your workflow contains white space, you'll need to replace the space with the URL encoded string `%20`. For more information about the `name` keyword, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#name)."
```
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_NAME>/badge.svg
```
Alternatively, if your workflow doesn't have a `name`, you must reference the workflow file using the file path relative to the repository's root directory.
{% note %}
**Note:** Referencing the workflow file using the file path does not work if the workflow has a `name`.
{% endnote %}
```
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_FILE_PATH>/badge.svg
```
### Using a workflow name
This Markdown example adds a status badge for a workflow with the name "Greet Everyone." The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
```markdown
![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg)
```
### Using a workflow file path
This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
```markdown
![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg)
```
### Using the `branch` parameter
This Markdown example adds a status badge for a branch with the name `feature-1`.
```markdown
![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1)
```
### Using the `event` parameter
This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event.
```markdown
![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request)
```