actions / toolkit

The GitHub ToolKit for developing GitHub Actions.
https://github.com/features/actions
MIT License
4.97k stars 1.43k forks source link

Possible to access GitHub Actions contexts in general? #599

Open weibeld opened 4 years ago

weibeld commented 4 years ago

GitHub Actions provides various contexts, such as github, job, runner, which can be accessed from various places in a workflow. Is it possible to access these contexts with this toolkit too?

From what I have seen, only a part of the github context can be accessed through the github.context object in the @actions/github package. However, this is not exactly identical to the github context, and also all the other contexts, as listed here, don't seem to be accessible.

thboop commented 4 years ago

You can't currently access the other contexts in the toolkit like you can the github context.

If you need a value from one of those, please add it as an action input and instruct workflow authors to pass it into your action

weibeld commented 4 years ago

Ok, thanks. Is it planned to add this? Or is it possible at all?

thboop commented 3 years ago

It's not currently planned, but you can add it as an action input and consume those values that way.

daltonv commented 2 years ago

Is it documented anywhere what is actually included in the @action/github's github.context var?

I also assumed that it would use the full github context shown in the documentation: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context