1.0.1 • Published 6 months ago

github-checks v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

GitHub-Checks CLI

github-checks is a small CLI tool to create and update check runs for commits on GitHub. It is designed to be used in CI/CD pipelines.

This tool uses the GitHub Check Runs REST API.

Installation

npm install -g github-checks

Alternatively, you can use npx to run the CLI without installing it:

npx github-checks ...

Usage

There are 2 commands available:

  • create - Create a new check run
  • update - Update an existing check run

Commands

  1. Create a new check run

    npx github-checks create --accessToken=<string> --owner=<string> --repo=<string> --head_sha=<string> --name=<string> --status=queued|in_progress --details_url=<string>
    npx github-checks create --accessToken=<string> --owner=<string> --repo=<string> --head_sha=<string> --name=<string> --status=completed --conclusion=<string> --details_url=<string>

    This command returns the checkRunId that you can use to update the check run:

    Refer to the Error Handling section for details on failure behavior.

  2. Update an existing check run

    npx github-checks update --accessToken=<string> --owner=<string> --repo=<string> --head_sha=<string> --checkRunId=<string> --name=<string> --status=queued|in_progress --details_url=<string> --output.title=<string> --output.summary=<string>
    npx github-checks update --accessToken=<string> --owner=<string> --repo=<string> --head_sha=<string> --checkRunId=<string> --name=<string> --status=completed --conclusion=<string> --details_url=<string> --output.title=<string> --output.summary=<string>

    If successful, the command will return the updated check run and return success in the terminal:

    Refer to the Error Handling section for details on failure behavior.

Environment Variables

Alternatively, you can just set the environment variables for the following parameters:

  • GITHUB_ACCESS_TOKEN=<string>
  • OWNER=<string>
  • REPO=<string>
  • HEAD_SHA=<string>

These environment variables will be used as default values for the CLI arguments. You can still override them by passing the arguments.

Error Handling

On failure, the CLI throws an error and exits with the status code 1.

Resilience

If the request fails, the CLI will retry the request up to 3 times before failing.

Documentation

A detailed documentation will be available soon.

1.0.1

6 months ago

1.0.0

7 months ago

0.3.0

7 months ago

0.2.2

8 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago