toolkit
toolkit copied to clipboard
Bug: `context.job` fails to take into account `jobs.<job_id>.name` value
Describe the bug
It appears as if context.job returns the value for jobs.<job_id> instead of jobs.<job_id>.name, which the user can opt to set via workflow syntax.
If jobs.<job_id>.name is set, can we return its value within context.job (or within a similarly-named new variable)?
To Reproduce
Steps to reproduce the behavior:
- Create a workflow like so:
on: pull_request jobs: demo: name: Demo Job runs-on: ubuntu-latest steps: - name: Echo job name uses: actions/github-script@v7 with: script: console.log(JSON.stringify(context.job)); - Observe as the output logs "demo" instead of "Demo Job".
Expected behavior
Instead of "demo", I would expect context.job to output "Demo Job" as that is its job name. If that's not possible, at least have a dedicated context.job_name to return the proper job name.
context comes from @actions/github so I'll transfer this to the toolkit repo.
Thank you for transferring @joshmgross, and feel free to let me know if I can provide any more information to help troubleshooting.