Skip to content

[bug] Environment variable parsing is inconsistent. ${{ github.action_path }} is different than $GITHUB_ACTION_PATH in env.GITHUB_ACTION_PATH=${{ github.action_path }} #417

Description

@alexrecuenco

The environment variables are parsed differently on the steps than they are inside the script, because the exec step inherits the environment from the parent

This is an excerpt of a run step inside a container I was testing

Essentially, when you use env.GITHUB_ACTION_PATH=${{ github.action_path }} you get a different result in the environment variable as if you used the ${{ github.action_path }} directly. I think this has to do with how the exec script is currently done and streamed. there might need to be some proxy to the variables to imrpote this

  steps:
    - shell: bash
      env:
        GITHUB_ACTION_PATH: ${{ github.action_path }}
        WORKSPACE: ${{ github.workspace }}
      run: |
        echo External ACTION PATH: GITHUB_ACTION_PATH="${GITHUB_ACTION_PATH}"
        echo ACTION PATH INSIDE SCRIPT: ${{ github.action_path }}

        echo External WORKSPACE: WORKSPACE="${WORKSPACE}"
        $ External ACTION PATH: GITHUB_ACTION_PATH=/__w/repo/repo/./actions/linter-configs
        $ ACTION PATH INSIDE SCRIPT: /home/runner/_work/repo/repo/./actions/linter-configs
        $ External WORKSPACE: WORKSPACE=/__w/repo/repo
        $ WORKSPACE INSIDE SCRIPT: /home/runner/_work/repo/repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions