Hi, is there some self referential way to access the job name given by the name key at the workflow level inside of the job? Given that “name” is a reserved parameter I thought maybe something like this would work:
jobs:
build:
docker:
- image: buildpack-deps
resource_class: small
steps:
- mycommand:
jobname: <<parameters.name>> # <---- How can I achieve this?!?
workflows:
build-workflow:
jobs:
- build:
name: somename
I’ve tried a few other things also to no avail, hoping there is a way thanks!
I can not say why name is a reserved parameter, but to do what you wish to do, you would use parameters as shown here under 'Passing parameters to jobs"
I think the job name you specify under workflows is different from the name you give a run step.
workflows → Shows up under Github UI as the name of the job
run step name → Shows up under the CircleCI UI as the currently running step under that job.
I’m trying to reuse the job_name and pass it as a parameter through to my run step to avoid having to redundantly specify the same string twice.
jobs:
build:
parameter:
someparam:
type: string
docker:
- image: buildpack-deps
resource_class: small
steps:
- mycommand:
jobname: <<parameters.somename>> # <---- Would be nice to use job name here, not redundant param
workflows:
build-workflow:
jobs:
- build:
name: somename # <---- shows up under Gihub UI
paramname: somename # <---- passed down to run step name. redundant!
Hopefully that explains a bit better what I’m asking for.
Thanks