docs icon indicating copy to clipboard operation
docs copied to clipboard

default environment variables - where can they be used?

Open valentin-krasontovitsch opened this issue 1 year ago • 4 comments

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

What part(s) of the article would you like to see updated?

the section on default environment variables. it says

The default environment variables that GitHub sets are available to every step in a workflow.

but when I try for instance to use such a variable as input to a step using a composite action, as in

      - name: Fetch job html
        uses: ./.github/actions/job_html_url
        with:
          job_name: ${{ env.GITHUB_JOB }}

the passed input is the empty string.

I would like to see more specifically where in a step these env vars can be used, as i would expect that they can be accessed using the env context in expressions, but apparently this is not the case. not even a step with

        run: echo ${{ env.GITHUB_JOB }}

works! it seems they are not accessible through the env context at all :thinking:

Additional information

No response

valentin-krasontovitsch avatar Apr 05 '23 17:04 valentin-krasontovitsch

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar Apr 05 '23 17:04 welcome[bot]

@valentin-krasontovitsch Thank you for opening an issue and linking it to your PR! ✨

cmwilson21 avatar Apr 05 '23 20:04 cmwilson21

A stale label has been added to this issue becuase it has been open for 60 days with no activity. To keep this issue open, add a comment within 3 days.

github-actions[bot] avatar Jun 05 '23 16:06 github-actions[bot]

we have a PR, which is waiting for review

valentin-krasontovitsch avatar Jun 06 '23 09:06 valentin-krasontovitsch

A stale label has been added to this issue because it has been open for 60 days with no activity. To keep this issue open, add a comment within 3 days.

github-actions[bot] avatar Aug 07 '23 16:08 github-actions[bot]

we still have a PR, which is waiting for review

valentin-krasontovitsch avatar Aug 08 '23 13:08 valentin-krasontovitsch