I would like to access the deployment environment name in my Github Actions workflow YAML. Here is an example:
jobs:
example:
runs-on: ubuntu-latest
environment: "foobarbaz"
...
steps:
...
- name: Terraform Check Format
id: terraform-fmt
# what should I use here instead of "????" to get "foobarbaz"?
run: terraform -chdir=terraform/stacks/${{ ???? }}/${{ matrix.stack }} fmt -check
2
Answers
Should be stored under:
See:
As
jobs
context is only available in reusable workflows one of working option could be useenv
: