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.
npm install @netsells/reg-suit-basic-git-hash-pluginThis module is a plugin for reg-suit that provides basic functionality to set the Head and Base sha states for your reg-suit tests.
``sh`
$ 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": {}
}
}
This plugin runs off of two env variables:
- BASE_SHA - the SHA of the commit that the current changes should be compared withHEAD_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.:
`yml`
- 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.