From f9b50ac4387b46f8a3ca80ede226fb15384ff7f3 Mon Sep 17 00:00:00 2001 From: Beth Brennan <34719884+elbrenn@users.noreply.github.com> Date: Fri, 19 Feb 2021 15:20:42 -0500 Subject: [PATCH] use new workflow filename routes for badges (#17518) * use new workflow filename routes for badges * file name * use real repo name --- .../adding-a-workflow-status-badge.md | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md b/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md index 523e8d551c..92fa7fc3d7 100644 --- a/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md +++ b/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md @@ -12,38 +12,17 @@ versions: {% 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)." +You reference the workflow by the name of your workflow file. ``` -https://github.com///workflows//badge.svg +https://github.com///actions/workflows//badge.svg ``` +### Using the workflow file name -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///workflows//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`. +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`. ```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) +![example workflow](https://github.com/github/docs/actions/workflows/main.yml/badge.svg) ``` ### Using the `branch` parameter @@ -51,7 +30,7 @@ This Markdown example adds a status badge for a workflow with the file path `.gi 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) +![example branch parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?branch=feature-1) ``` ### Using the `event` parameter @@ -59,5 +38,5 @@ This Markdown example adds a status badge for a branch with the name `feature-1` 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) +![example event parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?event=pull_request) ```