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

Feature request: split context out from @actions/github #430

Open
jhenstridge opened this issue Apr 24, 2020 · 1 comment
Open

Feature request: split context out from @actions/github #430

jhenstridge opened this issue Apr 24, 2020 · 1 comment
Labels
enhancement New feature or request github

Comments

@jhenstridge
Copy link

Describe the enhancement
The information provided by the github.context object provided by the @actions/github package provides a lot of useful information about why an action has been invoked. It doesn't necessarily follow that code using this information will also access the Github REST API.

Importing the package and making a simple access to github.context significantly increased the compile time, and added almost 600 KB to the packed version of my action. That seems a bit excessive.

It would be nice if I could get access to the context information without pulling in all of Octokit. It almost feels like it would make sense in @actions/core, although maybe the information isn't quite that universally useful.

Additional information
I realise I can reach into the package's internals to get the context only with something like:

import {Context} from '@actions/github/lib/context.js'
const context = new Context()

But there is no guarantee that that will continue to work as new versions are released.

@jhenstridge jhenstridge added the enhancement New feature or request label Apr 24, 2020
@jhenstridge
Copy link
Author

Alternatively, it would be nice if an import like the following:

import {context} from '@actions/github'

... would eliminate the Octokit parts as dead code.

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

No branches or pull requests

2 participants