act
act copied to clipboard
Enhancement: Fail if env variable is used in strategy of a job
Describe feature
The following configuration works in act:
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
.github/workflows/main.yml#L14The workflow is not valid. .github/workflows/main.yml (Line: 14, Col: 31): Unrecognized named-value: 'env'. Located at position 1 within expression: env.target_python_version
Sadly, this is not supported:
- https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#env
- https://github.com/actions/runner/issues/480
- https://github.community/t/env-vars-are-not-expanded-causing-dry-violations/16550
- https://github.community/t/how-to-use-env-context/16975/2
- https://github.com/fbradyirl/openwrt-luci-rpc/pull/47
Issue is stale and will be closed in 14 days unless there is new activity
I am very new to act and github actions, so my assumption that my issue is related might be wrong. I am seeing at least the same error, if I try to skip an entire workflow locally. https://github.com/zbMATHOpen/linksApi/blob/master/.github/workflows/codeql-analysis.yml#L27 I wonder if the is a different method people use to determine if the job is executed on github or locally.
@physikerwelt you don't use environment variables in matrix so it's definitely not the same issue
Check out https://github.com/rhysd/actionlint to lint your workflow files.