Skip to content

github.event_path cannot be passed through env var #701

Open

Description

@edtan

Describe the bug
When passing ${{ github.event_path }} through as an environment variable, it ends up getting blanked out when trying to use the environment variable. The environment variable approach was previously working on v2.273.0, but appears to have broke in v2.273.1.

To Reproduce
Use the following workflow below.

name: event_path (manual trigger)
on:
  workflow_dispatch:
jobs:
  test:
    runs-on: 'ubuntu-latest'
    steps:
    # - name: Printing through context works
    #   run: |
    #     echo ${{ github.event_path }}
    - name: Printing through env var does not
      run: |
        echo $EVENT_PATH
      env:
        EVENT_PATH: ${{ github.event_path }}

Expected behavior
The value of ${{ github.event_path }} should be accessible as an environment variable.

Runner Version and Platform

Version of your runner? v2.273.1

OS of the machine running the runner? ubuntu-latest

Activity

  1. ruvceskistefan commented on Mar 31, 2022

    @ruvceskistefan
    Contributor

    Hi @edtan,

    I tried to reproduce the reported bug, but I didn't have any success. I'm sending a link to a successfully completed workflow: https://github.com/ruvceskistefan/git-runner-test/runs/5768372718?check_suite_focus=true

    Since this does not happen on newer verions of runner, I will close this issue. Feel free to reopen it if the problem still exists or you have more questions.

  2. ChristopherHX commented on Mar 31, 2022

    @ChristopherHX
    Contributor

    Since this does not happen on newer verions of runner

    It does happen, but only in the first step of a job

    name: event_path (manual trigger)
    on:
      push:
    jobs:
      test:
        runs-on: 'ubuntu-latest'
        steps:
        # Step 1 Broken
        - name: Printing through env var does not
          run: |
            echo $EVENT_PATH
          env:
            EVENT_PATH: ${{ github.event_path }}
        # Step 2 Working
        - name: Printing through env var works now
          run: |
            echo $EVENT_PATH
          env:
            EVENT_PATH: ${{ github.event_path }}

    LOG of runner 2.288.0

    Current runner version: '2.288.0'
    Runner name: 'ubuntu'
    Runner group name: 'misc'
    Machine name: 'ubuntu'
    Prepare workflow directory
    Prepare all required actions
    ##[group]Run echo $EVENT_PATH
    echo $EVENT_PATH
    shell: /usr/bin/bash -e {0}
    env:
      EVENT_PATH: 
    ##[endgroup]
    ##[group]Run echo $EVENT_PATH
    echo $EVENT_PATH
    shell: /usr/bin/bash -e {0}
    env:
      EVENT_PATH: /home/ubuntu/actions-runner-v2.283.4/_work/_temp/_github_workflow/event.json
    ##[endgroup]
    /home/ubuntu/actions-runner-v2.283.4/_work/_temp/_github_workflow/event.json
    Cleaning up orphan processes
    
  3. ruvceskistefan commented on Mar 31, 2022

    @ruvceskistefan
    Contributor

    Okay, now it's clear, thanks for the explanation @ChristopherHX!
    I'm going to reopen this issue and I'll come back to you when we have more information about the bug itself.

  4. removed their assignment
    on Mar 31, 2022
  5. arianvp commented on Aug 27, 2025

    @arianvp

    any update on this. this is still broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Runner BugBug fix scope to the runnerbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions