Workflow level `env` does not work properly in all fields.
See original GitHub issueDescribe the bug
When using workflow level environment variables they do not work when I use them to substitute for jobs.build.name
or jobs.build.runs-on
. See workflow file below for example:
name: Testing workflow leve env vars
on:
push:
branches:
- develop
env:
aws_account: cfaittoolsnp
environment: dev
jobs:
build:
name: Deploy|${{ env.aws_account }}
runs-on: ${{ env.aws_account }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init
run: |
echo ${{ env.aws_account }}
To Reproduce
Steps to reproduce the behavior:
1.- Run the workflow file above to receive the following error:
The workflow is not valid. .github/workflows/dev.yml (Line: 15, Col: 11): Unrecognized named-value: 'env'. Located at position 1 within expression: env.aws_account,.github/workflows/dev.yml (Line: 16, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.aws_account
Expected behavior
The expected behavior is that using the workflow file above the build.name
would be Deploy|cfaittoolsnp
and the build.runs-on
would be cfaittoolsnp
.
Runner Version and Platform
Running latest version of linux self-hosted runner.
OS of the machine running the runner? linux (ubuntu 18.04)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:255
- Comments:45
Top GitHub Comments
This is also an issue with reusable workflow. For example:
Does not work.
@restjohn wrote:
Thanks for your input 😃
It may be true that that is how the implementation is implemented and intended currently (or not true, who knows?)
But: The sole purpose of an implementation of software is to serve the users needs, it has no purpose of its own.
Therefore, if it cannot serve the needs of the users, it has to change.
It should not be the other way around, the users should not be asked to change their needs to follow the needs of the implementation 😃