Manu Artero
Manu Artero

Reputation: 10243

GitHub Actions: name a workflow run triggered manually

Using GitHub Actions we have a workflow (deploy.yaml) that can be triggered both manually and as a result of a push event:

on:
  push:
    branches: ["master"]

  workflow_dispatch:
    inputs:
      env:
        description: 'env'
        required: true
        type: choice
        options: ...

When this workflow is executed due to push event, the run is named as the HEAD commit... but if the workflow is executed manually, the run uses the name of the yaml file (deploy in this scenario)

example of multiple workflow runs

Is it possible to name a run that has been triggered manually?

Upvotes: 3

Views: 2292

Answers (2)

wilkystyle
wilkystyle

Reputation: 337

Update

Support for this feature was added to GitHub Actions on Sep 26, 2022

Original answer

As of Sep 3, 2022, it appears that this is not possible. There is an unanswered feature request discussion on the GitHub Actions community forum, but no apparent decision has yet been made.

Upvotes: 3

kai
kai

Reputation: 1354

This feature is now live from September 26, 2022

Simply specify the run-name which accepts expressions:

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

on:
  push:
    branches: ["master"]

  workflow_dispatch:
    inputs:
      env:
        description: 'env'
        required: true
        type: choice
        options: ...

For further info see the documentation

Upvotes: 1

Related Questions