question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unrecognized named-value: 'env'. Located at position 1 within expression" when used in reusable workflow jobs

See original GitHub issue

Describe the bug Usage of env in workflow that uses reusable workflow generates “Unrecognized named-value: ‘env’. Located at position 1 within expression”

To Reproduce Use the following yml:

name: Test Workflow

on:
  push:

env:
  SOMETHING: 1000

  test:
    name: call workflow
    uses: ./.github/workflows/callee.yml
    secrets: inherit
    with:
      run_url: "{run_url}"
      message: ${{ env.SOMETHING }}

Expected behavior env.SOMETHING is usable and can be passed into reusable workflow

Actual behavior

The workflow is not valid. .github/workflows/create-branch.yml (Line: #, Col: ##): Unrecognized named-value: 'env'. Located at position 1 within expression: env.SOMETHING

Runner Version and Platform

Version of your runner?

OS of the machine running the runner? ubuntu-latest

What’s not working?

image

Issue Analytics

  • State:open
  • Created 8 months ago
  • Reactions:60
  • Comments:28

github_iconTop GitHub Comments

11reactions
harrisrobincommented, Apr 21, 2023

I guess I wasted 30 mins of my life and ended up here like the rest of us

8reactions
alexl-shopwarecommented, Apr 18, 2023

+1. Get this fixed github, cmon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variables in github actions
The error Unrecognized named-value: 'env' is telling you that GitHub is not recognizing the YAML you wrote at line 13. It's a syntax...
Read more >
Passing values between steps in Github Actions
This creates an environment variable called TERMINUS_RELEASE that is accessible by any step after this one either directly within a script ( $ ......
Read more >
GitHub Actions - Is it possible to use event inputs in jobs.id. ...
According to the workflow syntax it's possible to do this: on: ... Located at position 1 within expression: github.event.inputs.src_ref.
Read more >
Simplify using secrets with reusable workflows
GitHub Actions simplifies using secrets with reusable workflows with the secrets: inherit keyword. Previously when passing secrets to a ...
Read more >
Untitled
DOCKER_USERNAME. github / workflows / cicd. yaml (Line: 22, Col: 24): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found