Skip to content

getunlatch/jscpd-github-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

Check code duplicates github action

This action annotates pull requests with one notice for every modified chunk that seems to contain duplicated code.

The code duplications are made with jscpd.

You can instal jscpd in local and run it in your repository to find all duplicates.

You can configure ignored patterns and other options by commiting a .jscpd.json file in your repository.

If you have a large repository, you'll run into out of memory issue except if you use the leveldb store.

Example usage

on: [pull_request]

jobs:
  cpd:
    runs-on: ubuntu-latest
    name: Check duplicated code
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Check duplication
        uses: getunlatch/[email protected]
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"