I want to define a key-value pair for the entire workflow and access it in the with
block of multiple jobs.
Right now, I get the error:
The workflow is not valid. .github/workflows/main.yaml (Line: 41, Col: 25): Unrecognized named-value: 'env'. Located at position 1 within expression: env.database_version .github/workflows/main.yaml (Line: 64, Col: 25): Unrecognized named-value: 'env'. Located at position 1 within expression: env.database_version
My snippet is as follows:
name: Main
on:
push:
branches:
- main
- fix-main-deployment-workflow-post-database_version
env:
database_version: 3.1.0-git-c919c26
jobs:
<job_name>:
name: Deploy to <some zone>
needs:
- helm
- docker
uses: <another yaml>
with:
database_version: ${{ env.database_version }}
I also tried removing the env
and directly referencing it:
The workflow is not valid. .github/workflows/main.yaml (Line: 41, Col: 25): Unrecognized named-value: 'database_version'. Located at position 1 within expression: database_version .github/workflows/main.yaml (Line: 64, Col: 25): Unrecognized named-value: 'database_version'. Located at position 1 within expression: database_version
steps
field in the<job_name>
implementation you shared. Is it informed on the original workflow? – Mcclintockuses
section has the steps in many jobs. – Marleen