@cypress/github-commit-status-check

Set GitHub commit status

Usage no npm install needed!

<script type="module">
  import cypressGithubCommitStatusCheck from 'https://cdn.skypack.dev/@cypress/github-commit-status-check';
</script>

README

@cypress/github-commit-status-check

Small utility for setting GitHub commit status based on GH app installation

This utility is meant to be used by GitHub App installations. Thus your environment should have the following 3 pieces of authentication information set as environment variables:

  • GH_APP_ID
  • GH_INSTALLATION_ID
  • GH_PRIVATE_KEY

The GH_PRIVATE_KEY is the base64-encoded private key. For example, if you copy the contents of the private "pem" file into your clipboard, from the terminal you can execute "pbpaste | base64 | pbcopy" and get the encoded string in the clipboard.

As always, for local use I recommend as-a utility.

Use

Primary use via module API, see src/index.ts

Setting commit check

import { setCommitStatus } from '@cypress/github-commit-status-check'
await setCommitStatus({
  // bunch of options
})

There is a bin script src/bin/set-commit-status.ts that reads options from command line arguments. For example, if environment variables are stored under block set-status in your as-a settings, then:

$ as-a set-status npm run set-commit-status -- --repo ...

Adding comment to a commit

$ as-a set-status npm run add-commit-comment -- --repo ...

Debugging

Run with environment variable DEBUG=@cypress/github-commit-status-check to see more log messages