Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commit-status

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commit-status

Simple command-line application to post commit status to GitHub (for use in CI)

  • 4.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
367
decreased by-18.26%
Maintainers
2
Weekly downloads
 
Created
Source

commit-status

A simple CLI tool to post commit statuses to GitHub from CI.

About

At Taskworld, we want to have fine-grain status report for each commit. This is a perfect use case for GitHub’s commit status API.

Usage

Configure CI to expose GitHub access token

commit-status will look for GitHub access from these environment variables, in this order:

  • GH_STATUS_TOKEN
  • GH_TOKEN

That token should have repo:status scope.

You can create a bot account and obtain a token at https://github.com/settings/tokens/new.

Use with GitHub Enterprise

If you use GitHub Enterprise, then you can override the API endpoint by GITHUB_API environment variable.

env GITHUB_API=https://[hostname]/api/v3 commit-message ...

CLI

Install

Inside your CI deps script, install commit-status there:

npm install -g commit-status

Post commit status

Whenever you want to post a commit status from CI, invoke the command:

commit-status <state> <context> <description> [<url>]
  • state — Either pending, success, error, failure
  • context — “A string label to differentiate this status from the status of other systems.”
  • description — “A short description of the status.”
  • url — The URL to display.

Example CircleCI setup:

    - |
      if gulp lint
      then commit-status success lint/eslint "Linting successful."
      else commit-status failure lint/eslint "There are lint errors."
      fi

API

const commitStatus = require('commit-status')

commitStatus.post({
  state: 'success',
  context: 'lint/eslint',
  description: 'Linting successful.'
})

FAQs

Package last updated on 06 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc