How do I create a github workflow step name with a variable value.
I tried this but it does not work.
name: Publish
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- name: Log into Container registry ${{ env.REGISTRY }}
2
Answers
Since this does not seem supported, it is better to add an echo which prints the variable, before one processing it:
After that, for runtime variables, you can add conditions:
I know you tried it, but reproducing the workflow here with your implementation (as below) actually worked for me.
The job step name was generated dynamically according to the workflow
env variable
set.Here is the workflow run