Skip to content

This GitHub action detects NSFW content in a commited files.

License

Notifications You must be signed in to change notification settings

fabasoad/nsfw-detection-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

NSFW detection action

Stand With Ukraine GitHub release (latest SemVer including pre-releases) functional-tests security linting

This action checks each modified and added file with the extensions that is defined in action configuration and failed in case of threshold of NSFW check is greater or equals to the threshold defined in action configuration. NSFW detection runs by chosen provider.

Contents

Providers

Cloudmersive

Identifier is cloudmersive. Sign up to Cloudmersive official website. Then go to API Keys page, create a new one and copy it.

PicPurify

Identifier is picpurify. Sign up to PicPurify official website. Then go to API Keys page and copy API key that is located on the top of the page.

SightEngine

Identifier is sightengine. Sign up to SightEngine official website. Then go to Get Started page and copy API user and API secret from the examples provided. This provider requires to provide 2 API identifiers, so please put them into api-key parameter separated by comma. For example, api-key should be 123456,abcdef if your api_user is 123456 and api_secret is abcdef.

Supported OS

OS
Windows
Linux
macOS

Prerequisites

The following tools have to be installed for successful work of this GitHub Action: curl, awk.

Inputs

- uses: fabasoad/nsfw-detection-action@v3
  with:
    # (Required) Provider identifier.
    provider: "picpurify"
    # (Required) API key required for the selected provider.
    api-key: ${{ secrets.PICPURIFY_API_KEY }}
    # (Required) The action will fail if the NSFW detection value is greater
    # than or equal to this parameter.
    threshold: "0.6"
    # (Optional) Comma-separated list of file extensions for NSFW detection.
    # Defaults to "jpeg,jpg,png,gif,webp,tiff,bmp".
    extensions: "jpg,png,gif"
    # (Optional) Comma-separated types of changes made during work on the branch.
    # Defaults to "added,copied,modified,renamed".
    types: "added,modified"

Outputs

None.