Skip to content

remove env[VAR] syntax, avoid to error 'Unrecognized named-value' #3

remove env[VAR] syntax, avoid to error 'Unrecognized named-value'

remove env[VAR] syntax, avoid to error 'Unrecognized named-value' #3

Workflow file for this run

on: push
name: environemnt variables
env:
NEW_ENV: value
jobs:
build:
name: test
runs-on: ubuntu-latest
steps:
- name: env
run: echo ${{ env }}
- name: custom environment variable
run: echo env.NEW_ENV = ${{ env.NEW_ENV }} \$NEW_ENV = $NEW_ENV
# Unrecognized ERROR
# - name: custom environment variable
# run: echo env[NEW_ENV] = ${{ env[NEW_ENV] }}
- name: custom environment variable
run: echo env[PATH] = ${{ env[PATH] }}

Check failure on line 20 in .github/workflows/environment.yml

View workflow run for this annotation

GitHub Actions / environemnt variables

Invalid workflow file

The workflow is not valid. .github/workflows/environment.yml (Line: 20, Col: 14): Unrecognized named-value: 'PATH'. Located at position 5 within expression: env[PATH]