Skip to content

ENV vars are not expanded, causing DRY violations #25850

Answered by ethomson
eduncan911 asked this question in Actions
Discussion options

You must be logged in to vote

No, that’s not expanded since the YAML is not evaluated in the context of the bourne shell.  You can use the YAML variable expansion, though:

name: Go
on: [push]
jobs:

build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
env:
CODE: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}

- name: Print Code
  run: echo ${CODE}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants