Description
Describe the enhancement
Include job.<job_id>.environment
(if just name provided) or job.<job_id>.environment.name
in a context available to a step, if set.
Code Snippet
Something like what's below would be great:
jobs:
deploy-dev:
environment: dev
steps:
- name: deploy
uses: ./.github/actions/deploy-action
with:
environment: ${{job.environment_name}}
Additional information
It would be great if I could grab the desired name of the environment within a job that has the environment
object set. I'm retrieving this by parsing the workflow YAML file based with help from the GITHUB_WORKFLOW
and GITHUB_JOB
environment variables, but this isn't ideal and introduces unneeded complexity (i.e. if the top-level name
property within the workflow is set, then I have to dig within each YAML and check the name of the workflow).
I'm assuming that only the name would be available (if at all), since we can set the environment URL based on outputs from within a step.
Activity