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

Possible to access GitHub Actions contexts in general? #599

Open
weibeld opened this issue Oct 7, 2020 · 4 comments
Open

Possible to access GitHub Actions contexts in general? #599

weibeld opened this issue Oct 7, 2020 · 4 comments
Labels
enhancement New feature or request external

Comments

@weibeld
Copy link

weibeld commented Oct 7, 2020

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
Copy link
Collaborator

thboop commented Oct 8, 2020

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

@thboop thboop added the enhancement New feature or request label Oct 8, 2020
@weibeld
Copy link
Author

weibeld commented Oct 9, 2020

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

@thboop
Copy link
Collaborator

thboop commented Apr 30, 2021

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

@daltonv
Copy link

daltonv commented May 12, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request external
Projects
None yet
Development

No branches or pull requests

3 participants