0.2.1 • Published 4 years ago

@netsells/reg-suit-basic-git-hash-plugin v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Reg Suit Basic Git Hash Plugin

This module is a plugin for reg-suit that provides basic functionality to set the Head and Base sha states for your reg-suit tests.

Installation

$ yarn add -D @netsells/reg-suit-basic-git-hash-plugin

Add the plugin to your regconfig.json:

{
    "plugins": {
        "@netsells/reg-suit-basic-git-hash-plugin": {}
    }
}

Usage

This plugin runs off of two env variables:

  • BASE_SHA - the SHA of the commit that the current changes should be compared with
  • HEAD_SHA - the SHA of the current commit to build your regression suit from

How you populate these variables is up to you. For github actions you would pass them as an env variable in your reg-suit step, e.g.:

-   name: Run Reg-suit
    env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        BASE_SHA: ${{ github.event.pull_request.base.sha }}
        HEAD_SHA: ${{ github.event.pull_request.head.sha }}
    run: |
        yarn run reg-suit run

The above would populate the required env variables with the value from the github context and the pull_request even object.

If either of the SHA values are not provided they will fall back to the existing reg-keygen-git-hash-plugin plugin to try and infer these values from your current setup.