Skip to content

defi-wonderland/check-crypto-action

Repository files navigation

build-test tag badge license badge

Check Crypto Action

This action checks for crypto private keys in the diff code for the current commit and a specific branch.

Action Inputs

Input Description Default
branch Name of branch to compare Required
token Your GITHUB_TOKEN, used when sending the notification None
title Add a title to the notifications to distinguish between multiple workflows/jobs None
notify_issue Send a notification to the linked issue/pull-request with the summary true
notify_check Create a check run with the summary None
report_public_keys Report public keys into the pr summary None
only_notify Only notify the build without failing None

Note: In order to send issue notifications on Github, you must supply the token input

Action Outputs

Output Description
passed Boolean describing if the test passed or not

Usage

Example

The example below shows how to notify on a PR and check if it finds a crypto private key. comparing to the dev branch.

- name: Check for private keys
  uses: defi-wonderland/check-crypto-action@v1
  with:
    title: Check private key and notify
    branch: dev
    notify_check: true
    token: ${{ secrets.GITHUB_TOKEN }}

The example below shows how to only check without notifying on a PR if it finds a crypto private key. comparing to the dev branch.

- name: Check for private keys
  uses: defi-wonderland/check-crypto-action@v1
  with:
    title: Check private key and notify
    branch: dev
    notify_issue: false
    notify_check: true
    token: ${{ secrets.GITHUB_TOKEN }}

The example below shows how to notify without ever failing on a PR if it finds a crypto private key. comparing to the dev branch.

- name: Check for private keys
  uses: defi-wonderland/check-crypto-action@v1
  with:
    title: Check private key and notify
    branch: dev
    only_notify: true
    token: ${{ secrets.GITHUB_TOKEN }}

Development

Install the dependencies

npm install

Build the typescript and package it for distribution

npm run build && npm run package

Run the tests ✔️

npm test

License

The scripts and documentation in this project are released under the MIT License