JSPM

create-check

0.5.1-canary.65dc523
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9173
  • Score
    100M100P100Q112917F
  • License MIT

Create a GitHub check + annotation

Package Exports

  • create-check

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-check) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

create-check

Create a GitHub check with annotations on a PR

Highlights

  • Detects PR number and creates check w/annotations
  • Does nothing locally
  • Only runs in CI environment

Install

npm install --save-dev create-check
# or
yarn add -D create-check

Usage

Everything is written in typescript with JSDOC comments so your editor should tell you what each option is and does.

import createCheck from 'create-check';

async function main() {
  await createCheck({
    tool: 'stylelint',
    name: 'Check Styles for Errors',
    annotations: createAnnotations(results),
    errorCount,
    warningCount,
    appId: APP_ID,
    privateKey: PRIVATE_KEY
  });

  console.log('Created check on PR');
}

main();

Changing GitHub URL (enterprise)

To get this package to work on github enterprise instances you will need to set the GH_API or GITHUB_URL environment variable to a url pointing towards your enterprise GitHub's API.

Env Vars

This library will detect all the data it needs from the env, but sometimes a CI doesn't expose everything. The following env vars can be set:

  • REPO
  • OWNER