jobs:
my-name:
name: "My Name"
...
steps:
- name: Slack Notification
uses: my-action
with:
slack-msg: ${{ jobs.${{ env.GITHUB_JOB }}.name }}
I want that slack-msg to evaluate to "My Name". I'm using my-action in multiple jobs, and I always want to pass in the job name, but I don't know how to do that. When I tried the above, the job literally didn't run and I don't know how to troubleshoot why: the github workflow log for my-name
literally doesn't exist.
How do I pass job-name into an input parameter?
job_id
(in your carmy-name
) instead of thejob name
? Because thejob_id
is available in the Github Context using${{ github.job }}
when thejob name
is not...