To get the example to work (i.e. to have one workflow wait for another to complete) you need two files. Both files live in the .github/workflows folder of a repository.

The first file would be set up as usual. This file will be triggered by whatever event(s) are set in the on section:

---
name: Preflight

on:
  - pull_request
  - push

jobs:
  preflight-job:
    name: Preflight Step
    runs-on: ubuntu-latest
    steps:
      - run: env

The second file states that it should only trigger on the workflow_run event for any workflows with the name Preflight and must be on your repository's default branch, usually main or master:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - run: env

This more-or-less the same as the example from the GitHub Actions manual.

As you can see on the actions page of my example repo, the Preflight workflow will run first. After it has completed, the Test workflow will be triggered:

When you try this out, you will find that the Test workflow always runs the code and workflow configuration on your default branch, usually main or master.

This is because, (quoting from the manual):

This event will only trigger a workflow run if the workflow file is on the default branch.

This means you'll need to develop workflows triggered by workflow_run on your default branch, which is a little unfortunate.

This also means that if you need the "Test" workflow to run against the code of your branch or pull request, then you'll need to do more work as described below:

Every actions is run with a set of contexts. The github context holds information about the event that triggered the workflow. This includes the branch that the event was originally triggered from/for: github.event.workflow_run.head_branch.

This can be used to check out the origination branch in the action, using the actions/checkout action provided by GitHub.

To do this, the Yaml would be:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: '${{ github.event.workflow_run.head_repository.full_name }}'
          ref: ${{ github.event.workflow_run.head_branch }}
      - run: git branch
      - run: env
Answer from Potherca on Stack Overflow
🌐
GitHub
docs.github.com › actions › using-workflows › workflow-syntax-for-github-actions
Workflow syntax for GitHub Actions - GitHub Docs
If you omit name, GitHub displays ... workflow runs generated from the workflow. GitHub displays the workflow run name in the list of workflow runs on your repository's "Actions" tab....
Top answer
1 of 1
67

To get the example to work (i.e. to have one workflow wait for another to complete) you need two files. Both files live in the .github/workflows folder of a repository.

The first file would be set up as usual. This file will be triggered by whatever event(s) are set in the on section:

---
name: Preflight

on:
  - pull_request
  - push

jobs:
  preflight-job:
    name: Preflight Step
    runs-on: ubuntu-latest
    steps:
      - run: env

The second file states that it should only trigger on the workflow_run event for any workflows with the name Preflight and must be on your repository's default branch, usually main or master:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - run: env

This more-or-less the same as the example from the GitHub Actions manual.

As you can see on the actions page of my example repo, the Preflight workflow will run first. After it has completed, the Test workflow will be triggered:

When you try this out, you will find that the Test workflow always runs the code and workflow configuration on your default branch, usually main or master.

This is because, (quoting from the manual):

This event will only trigger a workflow run if the workflow file is on the default branch.

This means you'll need to develop workflows triggered by workflow_run on your default branch, which is a little unfortunate.

This also means that if you need the "Test" workflow to run against the code of your branch or pull request, then you'll need to do more work as described below:

Every actions is run with a set of contexts. The github context holds information about the event that triggered the workflow. This includes the branch that the event was originally triggered from/for: github.event.workflow_run.head_branch.

This can be used to check out the origination branch in the action, using the actions/checkout action provided by GitHub.

To do this, the Yaml would be:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: '${{ github.event.workflow_run.head_repository.full_name }}'
          ref: ${{ github.event.workflow_run.head_branch }}
      - run: git branch
      - run: env
Discussions

Using `workflow_run` in pull requests from non-default branches or forks
Select Topic Area Question Body I'm working a python repository, where I am using pre-commit. I have one workflow that runs code quality checks, and a set of other workflows (>=1) that will ... More on github.com
🌐 github.com
2
2
Name of Github action run in list - Stack Overflow
Is there a way to influence the title of the action in the list? ... I don't know if this is helpful for you but you can use something like a PR title checker. ... Since Sept. 2022, there might be a way to set the title of the run itself: GitHub Actions customers can now dynamically name their workflow ... More on stackoverflow.com
🌐 stackoverflow.com
GitHub Actions API: Get view workflow run history - Stack Overflow
I am looking for an API to retrieve previous runs of a specific workflow in GitHub Actions. I found the API that returns the previous runs of my entire repository, but I only need the runs of a spe... More on stackoverflow.com
🌐 stackoverflow.com
Show list of currently running workflows under an account/organization
Use the GitHub API: You can use the GitHub API to programmatically retrieve information about your running workflows. Specifically, you can use the List workflow runs for a repository endpoint (https://docs.github.com/en/rest/reference/actions#list-workflow-runs-for-a-repository) to retrieve ... More on github.com
🌐 github.com
5
8
March 17, 2023
🌐
GitHub
docs.github.com › actions › using-workflows › events-that-trigger-workflows
Events that trigger workflows - GitHub Docs
For information about each activity type, see Webhook events and payloads. By default, all activity types trigger workflows that run on this event. You can limit your workflow runs to specific activity types using the types keyword. For more information, see Workflow syntax for GitHub Actions.
🌐
GitHub
docs.github.com › en › rest › actions › workflow-runs
REST API endpoints for workflow runs - GitHub Docs
Refer to "Actions Get workflow usage and Get workflow run usage endpoints closing down" for more information. Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed ...
🌐
Medium
jiminbyun.medium.com › github-actions-workflow-run-vs-workflow-call-3f1a5c6e19d4
GitHub Actions: workflow_run vs. workflow_call | by Jimin | Medium
October 17, 2023 - # .github/workflows/first_workflow.yml name: First Workflow on: [push] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Build run: echo "Building the project..."
🌐
NimblePros
blog.nimblepros.com › blogs › using-workflow-run-in-github-actions
Using `workflow_run` in GitHub Actions | NimblePros Blog
March 1, 2023 - A write-access workflow_run trigger that runs after the first one does and writes the code coverage to the PR · The commenting workflow does need access to some of the files created by the first workflow, so I’ve added upload and download artifacts and am using the dawidd6/action-download-artifact action to get the artifacts from another workflow.
🌐
GitHub
docs.github.com › en › actions › reference › workflows-and-actions › workflow-commands
Workflow commands for GitHub Actions - GitHub Docs
This workflow uses an imaginary secret store, secret-store, which has imaginary commands store-secret and retrieve-secret. some/secret-store@ 27b31702a0e7fc50959f5ad993c78deac1bdfc29 is an imaginary action that installs the secret-store application and configures it to connect to an instance with credentials. ... on: push jobs: secret-generator: runs-on: ubuntu-latest outputs: handle: ${{ steps.generate-secret.outputs.handle }} steps: - uses: some/secret-store@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: credentials: ${{ secrets.SECRET_STORE_CREDENTIALS }} instance: ${{ secrets.SECRET_STORE_
Find elsewhere
🌐
GitHub
github.com › marketplace › actions › workflow_run-status
workflow_run status · Actions · GitHub Marketplace · GitHub
name: 'test_post' on: workflow_run: workflows: ["test"] types: - completed jobs: post-test-success: runs-on: ubuntu-latest steps: - uses: haya14busa/action-workflow_run-status@v1 - uses: actions/checkout@v2 - run: exit 0 post-test-failure: runs-on: ubuntu-latest steps: - uses: haya14busa/action-workflow_run-status@v1 - uses: actions/checkout@v2 - run: exit 1
🌐
GitHub
docs.github.com › en › actions › concepts › workflows-and-actions › workflows
Workflows - GitHub Docs
For example, you can configure your workflow to run when a push is made to the default branch of your repository, when a release is created, or when an issue is opened. Workflow triggers are defined with the on key. For more information, see Workflow syntax for GitHub Actions.
🌐
GitHub
docs.github.com › en › actions › monitoring-and-troubleshooting-workflows › monitoring-workflows › viewing-workflow-run-history
Viewing workflow run history - GitHub Docs
... Read access to the repository is required to perform these steps. On GitHub, navigate to the main page of the repository. Under your repository name, click Actions. In the left sidebar, click the workflow you want to see.
🌐
GitHub
docs.github.com › en › actions › using-workflows › manually-running-a-workflow
Manually running a workflow - GitHub Docs
September 28, 2022 - Under your repository name, click Actions. In the left sidebar, click the name of the workflow you want to run. Above the list of workflow runs, click the Run workflow button.
Top answer
1 of 2
14

Since Sept. 2022, there might be a way to set the title of the run itself:

GitHub Actions: Dynamic names for workflow runs (Sep. 2022)

GitHub Actions customers can now dynamically name their workflow runs.
The new run-name feature will accept expressions and be displayed on the list of workflow runs.

For more information on how to use run-name, visit the documentation.

For questions, visit the GitHub Actions community.

To see what's next for Actions, visit our public roadmap.

You now have:

The name for workflow runs generated from the workflow.
GitHub displays the workflow run name in the list of workflow runs on your repository's "Actions" tab.
If you omit run-name, the run name is set to event-specific information for the workflow run.
For example, for a workflow triggered by a push or pull_request event, it is set as the commit message.

This value can include expressions and can reference the github and inputs contexts.

Example

run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}

To expand on the documentation:

Example

Consider, as an example, a workflow in a project that involves both feature development and bug fixes.
That project uses two primary types of branches:

  • Feature branches: Prefixed with feature/
  • Bugfix branches: Prefixed with bugfix/

The workflow is triggered by pull requests targeting the main branch. You want the workflow run's name to reflect the type of work being integrated, the specific branch it is coming from, and the name of the user who initiated the run: that would help quickly identify the nature of the workflow run when looking through the Actions tab in the GitHub repository.

name: Integration CI

on:
  pull_request:
    branches: [ main ]

# Dynamically set the run name to include the type of branch (feature or bugfix), branch name, and the user
run-name: "${{ contains(github.head_ref, 'feature/') && 'Feature' || contains(github.head_ref, 'bugfix/') && 'Bugfix' || 'Update' }}: ${{ github.head_ref }} by @${{ github.actor }}"

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Setup Node.js
      uses: actions/setup-node@v2
      with:
        node-version: '14'
    - name: Install dependencies
      run: npm install
    - name: Run tests
      run: npm test

That workflow is configured to trigger on pull requests targeting the main branch.

The run-name field uses expressions to dynamically construct the run name based on the branch type (feature/ or bugfix/), the branch name, and the GitHub username of the actor who initiated the run.

  • If the branch is a feature branch (prefixed with feature/), the run name starts with "Feature".
  • If the branch is a bugfix branch (prefixed with bugfix/), the run name starts with "Bugfix".
  • For branches that do not match these prefixes, it defaults to "Update".
  • The run name also includes the branch name (github.head_ref) and the username of the actor who initiated the run (github.actor).

The example includes a simplified job called build-and-test that sets up a Node.js environment, installs dependencies, and runs tests. That part is standard for many JavaScript projects but can be customized based on your project's needs.

Context:

The run-name attribute in GitHub Actions workflows allows you to dynamically set the name of each workflow run. That feature is particularly useful for distinguishing between runs at a glance in the GitHub UI, especially in complex workflows triggered by various events or requiring specific context to understand the run's purpose or origin.

It supports expressions, enabling dynamic run names based on the context of the trigger event, inputs, or any other relevant information available in the GitHub context.
You can use context and expressions to tailor run names to reflect:

  • The type of trigger (push, pull_request, workflow_dispatch, etc.)
  • The branch name or tag
  • The actor initiating the run
  • Custom inputs for manual triggers
  • Any combination of available context information to form a meaningful name

That will:

  • makes it easier to navigate and understand the purpose of each run in the Actions tab.
  • helps maintainers quickly identify the type of work and the initiator of workflow runs, aiding in troubleshooting and prioritizing workflow reviews.
  • allows teams to systematically manage and monitor their CI/CD pipelines, especially in repositories with frequent and varied types of contributions.

In the case of a PR, as mentioned in the comments by Vytux, you can try a ternary-like expression that uses github.head_ref when it is available and falls back to github.ref_name (which is available for push events) when it is not.

name: Integration CI

on:
  pull_request:
    branches: [ main ]
  push:
    branches: [ main ]

# Use github.head_ref if available, otherwise fall back to github.ref_name.
run-name: "${{ github.head_ref != '' ? github.head_ref : github.ref_name }}: by @${{ github.actor }}"

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '14'
      - name: Install dependencies
        run: npm install
      - name: Run tests
        run: npm test
2 of 2
1

It does not seem like there is a way to set the title of the run itself (reference).

Scheduled and manual runs will get the title of the workflow, and runs triggered by commit / PR will get the commit message or PR title.

However, notice that the commit / PR title is displayed in addition to the name of the workflow, which appears in two places:

🌐
Orchestra
getorchestra.io › guides › github-actions-api-list-workflow-runs-for-a-workflow
Github Actions API: List workflow runs for a workflow | Orchestra
August 25, 2024 - With the REST API, you can interact ... the List workflow runs for a workflow endpoint, which allows you to retrieve details of all workflow runs for a specific workflow....
🌐
Polpiella
polpiella.dev › github-action-workflows-side-effects
GitHub Actions workflows side effects
April 26, 2023 - One of the features that I like the most about GitHub Actions is the number of different events that you can use to trigger a workflow. Triggers are defined using the on rule in the workflow file and there is a wide range of options available such as pushes to all or specific branches or changes to a pull request. I recently learnt, thanks to this tweet from James Sherlock, that you can also use GitHub webhook events to trigger workflow runs...
🌐
Orchestra
getorchestra.io › guides › github-actions-api-list-jobs-for-a-workflow-run
Github Actions API: List jobs for a workflow run | Orchestra
August 24, 2024 - To retrieve job details, you first need to identify the workflow run ID. You can obtain this from the GitHub Actions tab in your repository or by using the List workflow runs endpoint.
🌐
GitHub
github.com › orgs › community › discussions › 102876
workflow_run triggered only on success · community · Discussion #102876
Select Topic Area Question Body name: Workflow B on: workflow_dispatch: workflow_run: workflows: ["Workflow A"] types: - completed That triggers "Workflow B" regardless of the result of "Workflow A...
🌐
Spacelift
spacelift.io › blog › github-actions-workflows
GitHub Actions Workflows: How to Create and Manage
September 5, 2025 - We’re using ubuntu-latest for this job, but the GitHub Actions documentation provides a complete list of available runner environments. Within the job, we’re running two sequential steps: The first step uses the GitHub Marketplace’s checkout action to check out your repository into the job’s runner environment. The second step uses the run facility to run a command within the runner’s environment. For our example, the command just runs a simple echo statement. You can add more functionality to your workflow by creating additional jobs and steps as needed.