starter-workflows icon indicating copy to clipboard operation
starter-workflows copied to clipboard

access vars or jobs context in run name or a PUT API for updating run name

Open rwader-swi opened this issue 2 years ago • 6 comments

Currently the name in workflow run has only access to {{ inputs }} and {{ github }} contexts, which is not very useful as we might want to display additional info which are processed in the job steps.

  • either give access to {{ job }} context. It might solve this as it will update name after the job step is completed (from outputs)
  • or atleast access the {{ vars }} context, that we ultimately update in some job steps
  • If not that then atleast a PUT API endpoint for updating the run's metadata like run-name.

Neither of the above are avaialable 🙂

The users have to go inside every run to check such metadata, because its not displayed in name.

Essentially what differs each run is not just the inputs, but also some processing done from inputs.

For example in my usecase we update our software version for every release run by 1. And we want to display in the run name.

image

Will appreciate if anyone takes look into this feature ASAP!!!! And many people want this to be fixed.

rwader-swi avatar Jan 31 '24 08:01 rwader-swi

This issue has become stale and will be closed automatically within a period of time. Sorry about that.

github-actions[bot] avatar May 01 '24 04:05 github-actions[bot]

i think this is very useful feature allow update workflow run-name

mmichna avatar May 01 '24 05:05 mmichna

I would love this feature

marekkordik avatar May 02 '24 15:05 marekkordik

Hi GitHub Actions Team,

It would be incredibly beneficial to have the ability to dynamically edit run_name within workflows. This feature would enhance traceability, improve monitoring, and streamline debugging by allowing more descriptive and contextual run identifiers. Please consider adding this functionality to make our CI/CD pipelines even more powerful.

Thank you!

btungut avatar Jul 25 '24 01:07 btungut

I can confirm that this is working for me. Although the doc says that the run-name has only access to {{ inputs }} and {{ github }} contexts, but when I added a variable at the repository level (under Github secrets) and accessed it using the vars.DEFAULT_ENVIRONMENT surprisingly it worked.

May be this is an undocumented feature ( bit reluctant to post if they remove it after its discovery 😁 ).

on:
  push:
    branches:
      - main
    paths:
      - 'abcd/**'
  workflow_dispatch:
    inputs:
      environment:
        description: 'Choose the deployment environment'
        required: false
        default: 'DEV'
        type: choice
        options:
          - DEV
          - UAT
          - PROD

run-name: '${{ github.event.inputs.environment || vars.DEFAULT_ENVIRONMENT }} - Run ID: ${{ github.run_id }} - by @${{ github.actor }}'

koder101 avatar Dec 25 '24 08:12 koder101

It wouldn't be too complicated to modify the run-name at runtime with a Bash script command—this really shouldn't be that hard! 😊

btungut avatar Feb 19 '25 17:02 btungut