Feature request: split context out from @actions/github
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the public @actions/github package entry points and the existing @actions/github/lib/context.js implementation. Compare how @actions/core exposes shared functionality and determine where Context should be publicly provided without pulling in Octokit. Done means context is available through a supported package API while preserving the intended action context behavior and reducing unnecessary bundle and compile-time cost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100