1.0.0 • Published 4 years ago

octokit-plugin-action-context v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

octokit-plugin-action-context

Adds octokit.context object with all things relevant when run in a GitHub Action context

@latest Build Status Greenkeeper

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

License

MIT