Skip to content

Commit f9b50ac

Browse files
authored
use new workflow filename routes for badges (#17518)
* use new workflow filename routes for badges * file name * use real repo name
1 parent afd3cef commit f9b50ac

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,31 @@ versions:
1212

1313
{% data reusables.repositories.actions-workflow-status-badge-into %}
1414

15-
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)."
15+
You reference the workflow by the name of your workflow file.
1616

1717
```
18-
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_NAME>/badge.svg
18+
https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW_FILE>/badge.svg
1919
```
20+
### Using the workflow file name
2021

21-
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.
22-
23-
{% note %}
24-
25-
**Note:** Referencing the workflow file using the file path does not work if the workflow has a `name`.
26-
27-
{% endnote %}
28-
29-
```
30-
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_FILE_PATH>/badge.svg
31-
```
32-
33-
### Using a workflow name
34-
35-
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`.
36-
37-
```markdown
38-
![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg)
39-
```
40-
41-
### Using a workflow file path
42-
43-
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`.
22+
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 `github` organization and the `REPOSITORY` name is `docs`.
4423

4524
```markdown
46-
![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg)
25+
![example workflow](https://github.com/github/docs/actions/workflows/main.yml/badge.svg)
4726
```
4827

4928
### Using the `branch` parameter
5029

5130
This Markdown example adds a status badge for a branch with the name `feature-1`.
5231

5332
```markdown
54-
![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1)
33+
![example branch parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?branch=feature-1)
5534
```
5635

5736
### Using the `event` parameter
5837

5938
This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event.
6039

6140
```markdown
62-
![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request)
41+
![example event parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?event=pull_request)
6342
```

0 commit comments

Comments
 (0)