github-actions-checks

1.3.1 • Public • Published

Project logo

github-actions-checks

Status GitHub Issues GitHub Pull Requests License


A CLI-tool for generate github-actions workflow for pull-requests and master branch checks

📝 Table of Contents

🧐 About

We have created a project to configure the same type of checks. This package allows you to quickly configure the necessary checks for your repository using github-actions. This is a CLI tool with very simple usage.

🏁 Getting Started

Just run

npx github-actions-checks

The file .github.checks.json will appear in your repository. You can edit it as you like and re-run the utility to update workflow according to the config.
So, just edit this file and run again:

npx github-actions-checks

Then commit changes in your repository.

🎈 Usage

The main config - .github.checks.json
config by default:

{
  "env": {
    "NODE_ENV": "CI"
  },
  "jobs": [
    {
      "key": "checks",
      "steps": [
        {
          "key": "eslint",
          "name": "ESLint",
          "command": "npm run eslint"
        },
        {
          "key": "prettier",
          "name": "Prettier",
          "command": "npm run prettify"
        }
      ]
    },
    {
      "key": "tests",
      "steps": [
        {
          "key": "unit",
          "name": "Unit",
          "command": "npm run test"
        }
      ]
    }
  ],
  "showComments": false,
  "node": 16,
  "installCommand": "npm install",
  "buildCommand": ""
}

showComments - show Comments section

env - environment variables
jobs - asynchronous processes
each process will start a virtual machine with:
node - node.js version
installCommand - command to install dependencies
buildCommand - the command to build the project
useTurbo - use Turborepo cache

steps - array of checks within a separate process
each step has: key
name - Title
command - bash command
preCommand - prepare bash command
artifacts - array of folders with artifacts

in this example, 2 parallel processes will start:

  • in the first, checks will run one after the other: eslint and prettier,
  • in the second - unit tests

Screenshot of a github flow

💬 Comments

Works only in private repositories!

If you change {showComments: true} in .github.checks.json, a special comment with the status of checks will be displayed in the pull request.

Example of a comment when checks are in progress: Screenshot of a github flow

Example of a comment when one of the checks failed: Screenshot of a github flow

Example of a comment when one of the checks failed: Screenshot of a github flow

✍️ Authors

Package Sidebar

Install

npm i github-actions-checks

Weekly Downloads

0

Version

1.3.1

License

MIT

Unpacked Size

20.2 MB

Total Files

469

Last publish

Collaborators

  • sendsay