Closed jay-cresta closed 2 years ago
@jay-cresta The name of the job is test
. You are dynamically generating the name of the step in the test
job. There is no way to define a job name dynamically.
@ravgeetdhillon Sorry for the confusion caused because of partial code snippet. Actually that is the name property of the job (can be called description) and is not part of the steps. See below..
jobs:
test:
name: Run ${{ inputs.param1 }} tests on ${{ inputs.param2 }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
npm i
- name: Setup node 12
uses: actions/setup-node@v1
with:
node-version: 12.x
Is there a way to show the name property of the job? Thanks a ton!
@jay-cresta I'm not sure if this is possible. You can add the following step in your workflow and dump all the data and variables in your GitHub Action workflow.
echo "${{ toJson(github) }}"
If you find something you are looking for, you can use that property directly by doing:
${{ github.job.prop1.prop2.prop3 }}
Let me know if this works for you.
I hope the issue is fixed as the OP reacted with the 👍 to https://github.com/ravsamhq/notify-slack-action/issues/36#issuecomment-1040186259.
We have reusable job which runs on different parameters and also the name of the job is generated dynamically.
With a job setup something lie this, the name always prints as "test" in the slack notification instead of the name generated at runtime