octokit-plugin-action-context
v1.0.0
Published
Adds `octokit.context` object with all things relevant when run in a GitHub Action context
Downloads
4
Readme
octokit-plugin-action-context
Adds
octokit.context
object with all things relevant when run in a GitHub Action context
Usage
Browsers
octokit-plugin-action-context
is not meant for browser usage.
Node
Install with npm install @octokit/core octokit-plugin-action-context
. Optionally replace @octokit/core
with a core-compatible module
const { Octokit } = require("@octokit/core");
const { actionContext } = require("octokit-plugin-action-context");
const { Octokit } = require("@octokit/action");
const { actionContext } = require("octokit-plugin-action-context");
const OctokitWithContext = Octokit.plugin(actionContext);
const octokit = new OctokitWithContext();
const {
payload,
eventName,
sha,
ref,
workflow,
action,
actor,
repo,
issue,
} = octokit.context;
Contributing
See CONTRIBUTING.md