Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GitHub Actions] Output from called reusable workflows via env context or GITHUB_ENV is not supported #25620

Closed
1 task done
iamazeem opened this issue May 18, 2023 · 5 comments · Fixed by #25700
Closed
1 task done
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team help wanted Anyone is welcome to open a pull request to fix this issue waiting for review Issue/PR is waiting for a writer's review

Comments

@iamazeem
Copy link
Contributor

Code of Conduct

What article on docs.github.com is affected?

Reusable Workflows
https://docs.github.com/en/actions/using-workflows/reusing-workflows

Reusable Workflows: Limitations
https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations

Reusable Workflows: Using outputs from a reusable workflow
https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-outputs-from-a-reusable-workflow

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

According to the Limitations:

Any environment variables set in an env context defined at the workflow level in the caller workflow are not propagated to the called workflow.

The opposite is also not supported but it's not listed under the Limitations section.

Using outputs from a reusable workflow also does not mention anything about env context or GITHUB_ENV as it's mainly focused on the output parameters.

Adding this (i.e. env context or GITHUB_ENV cannot be used to set env vars for output purposes) under the Limitations section would be helpful.

Thanks!

Additional information

No response

@iamazeem iamazeem added the content This issue or pull request belongs to the Docs Content team label May 18, 2023
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label May 18, 2023
@cmwilson21
Copy link
Contributor

@iamazeem Thanks so much for opening an issue! I'll triage this for the team to take a look 👀

@cmwilson21 cmwilson21 added actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels May 19, 2023
@hubwriter
Copy link
Contributor

hubwriter commented May 22, 2023

@iamazeem - Thanks for raising this. Would the following fix this issue?

In Limitations (Markdown source file here), after the existing bullet point "Any environment variables set in an env context defined at the workflow level in the caller workflow are not propagated to the called workflow." add:

  • Similarly, environment variables set in the env context defined in the called workflow are not accessible in the env context in the caller workflow. Instead you must use outputs of the reusable workflow. For more information, see "[AUTOTITLE](/actions/using-workflows/reusing-workflows#using-outputs-from-a-reusable-workflow)."

Then at the end of the list of limitations, add:

  • Reusable workflows are called directly within a job, and not from within a job step. You cannot, therefore, use GITHUB_ENV to pass values to job steps in the caller workflow.

@iamazeem
Copy link
Contributor Author

@hubwriter: LGTM. 👍 That would definitely help.

@hubwriter hubwriter added the help wanted Anyone is welcome to open a pull request to fix this issue label May 25, 2023
@hubwriter
Copy link
Contributor

@iamazeem - Thanks for confirming.

Feel free for yourself (or anyone else) to open a PR to make this change. 🙇‍♂️

If you haven't contributed to the docs before, please take a look at our contributing guidelines.

@iamazeem
Copy link
Contributor Author

@hubwriter: PR #25700 created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team help wanted Anyone is welcome to open a pull request to fix this issue waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
3 participants