Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
align-left

GitHub Action

semgrep-action

v0.2-beta Pre-release

semgrep-action

align-left

semgrep-action

Easily detect and prevent bugs and anti-patterns in your codebase

Installation

Copy and paste the following snippet into your .yml file.

              

- name: semgrep-action

uses: semgrep/semgrep-action@v0.2-beta

Learn more about this action in semgrep/semgrep-action

Choose a version

sgrep action

This action runs sgrep and returns the output

Inputs

config

The config file|directory|yaml_url|tar|url|registry_name.

targets

The target(s) to scan

error

If true will exit 1 which will break the build.

Outputs

output

The output of sgrep

Example usage

Put in .github/workflows/sgrep.yml

name: sgrep

on: [push]

jobs:
  self_test:
    runs-on: ubuntu-latest
    name: A job to run sgrep
    steps:
      - uses: actions/checkout@v2
      - name: sgrep action step
        id: sgrep
        uses: returntocorp/sgrep-action@develop
        with:
          config: tests/self_test.yml
          targets: tests'
      - name: Get the output from sgrep
        run: echo "sgrep ${{ steps.sgrep.outputs.output }}"