Add environment name to a context available within a step
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start with the workflow YAML example and the existing job.environment value, then trace how context values are made available within a step. Done means a job's configured environment name can be referenced from a step without parsing the workflow YAML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github-actions
- Domain
- ci-cd
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100