I wanted to share this workflow if anyone is looking to have a dynamic environment name in the run-name.
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. You may use the same trick to achieve what you are looking for.
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 }}'
/actionspage. For example if someone on my team built 0.1.1, I would have to either ping a group chat or click on the latest workflow to find out the latest image tag.