-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow level env
does not work properly in all fields.
#480
Comments
I'm just wondering if there is any update on this? :) |
Unfortunately, no-- env can still not be used. However, I have found that I can use either of the following:
|
I'm new to GitHub, hence GitHub workflows. But this is the exactly the first issue I have with workflow. I'd image this is causing troubles for many of us. |
@leonardchu, give the first post a thumbs up. Github says that they monitor that. Other than that I'm not sure. |
Same issue with name: Python package
on: [push, pull_request]
env:
target_python_version: 3.8
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.7, "${{env.target_python_version}}"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
|
Publish to pypi only once in github actions Notes: * Github Actions does not support env in job strategy: actions/runner#480 (comment) * Trigger the workflow on push or pull request, but only for the master branch, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-multiple-events-with-activity-types-or-configuration
Hello! I'm having the same issue in the following context:
|
Same problem for me with |
It looks like instead of |
Sadly it looks like the env context can only be used inside steps: actions/runner#480
Any workarounds on this? I can't use |
mine - for https://github.com/nektos/act : diff --color -u -r .github/workflows/use-github-actions.yml .act-github/workflows/use-github-actions.yml
--- .github/workflows/use-github-actions.yml 2021-10-02 15:45:43.502705340 +0300
+++ .act-github/workflows/use-github-actions.yml 2021-10-02 15:45:43.516705231 +0300
@@ -2,6 +2,7 @@
test-fc-solve:
env:
WHAT: ${{ matrix.env.WHAT }}
+ if: ${{ ! contains(env.ACT_SKIP, matrix.env.WHAT) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Only in .github/workflows: windows-x64.yml
Only in .github/workflows: windows-x86.yml
|
This is quite the dealbreaker for a dynamic workflow :-S I hope this can be resolved asap. @shlomif looks promising, but I can't quite figure out what you're doing there. Could you provide a bit more context? |
Maybe |
* Make Flutter Build workflow reusable * provide artifact name via input variable (with default value) * Automatically add build artifacts to github release * workaround for actions/runner#480
apparently `env` isn't supported in `with:` statements. see actions/runner#480
Here is context-availability for env: |
Any update? This still seems to be broken for me. |
Also looking for an update on this. Are there plans to fix? |
We're having this same issue now. |
same |
+1, conditional runs-on is necessary for my workflow |
Much needed feature |
For some of the use cases outlined in this issue (eg: using a variable in a job name), it looks like Variables is what you're after. |
Honestly it is pretty unacceptable that the Our use case is far from uncommon: use the |
We're also having issues with shared workflows because of the runs-on limits. |
#2565 might be a different issue that is related to this one. Are expressions used in Jobs evaluated after the ones declared in Workflows ? If not, then it is another #2565 is another issue. |
I'm facing the same issue. Why are we able to pass |
How is this even an issue? Tagging resources is a perfect use case for this. It's been 3 years now, any news? |
Thank you for your interest in the runner application and taking the time to provide your valuable feedback. We kindly ask you to redirect this feedback to the GitHub Community Support Forum which our team actively monitors and would be a better place to start a discussion for new feature requests in GitHub Actions. For more information on this policy please read our contribution guidelines. 😃 |
@TingluoHuang : @github-actions wrote:
|
Describe the bug
When using workflow level environment variables they do not work when I use them to substitute for
jobs.build.name
orjobs.build.runs-on
. See workflow file below for example: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 beDeploy|cfaittoolsnp
and thebuild.runs-on
would becfaittoolsnp
.Runner Version and Platform
Running latest version of linux self-hosted runner.
OS of the machine running the runner? linux (ubuntu 18.04)
The text was updated successfully, but these errors were encountered: