platisd / duplicate-code-detection-tool

A simple Python3 tool to detect similarities between files within a repository
MIT License
162 stars 30 forks source link

Error: not enought source code fles #34

Open lukaas33 opened 1 month ago

lukaas33 commented 1 month ago

I want to use this action in my node js project. My github action is setup as follows:

name: Duplicate code detection

on: pull_request

jobs:
  duplicate-code-check:
    name: Check for duplicate code
    runs-on: ubuntu-20.04
    steps:
      - name: Check for duplicate code
        uses: platisd/duplicate-code-detection-tool@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          directories: "."

I am getting the following error:

 * [new ref]         refs/pull/120/head -> pull_request_branch
Switched to branch 'pull_request_branch'
Not enough source code files found
Action aborted due to bad user input
platisd commented 1 month ago

Hi! Can you try:

And let me know how it went?

lukaas33 commented 1 month ago

I have ran the following:

name: Duplicate code detection

on: pull_request

jobs:
  duplicate-code-check:
    name: Check for duplicate code
    runs-on: ubuntu-20.04
    steps:
      - name: List files in current directory
        run: pwd && ls .

      - name: Check for duplicate code
        uses: platisd/duplicate-code-detection-tool@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          directories: "./"

And got this result (repo and username redacted):

0s
Run pwd && ls .
  pwd && ls .
  shell: /usr/bin/bash -e {0}
/home/runner/work/[user name]/[repo name]
platisd commented 1 month ago

Hmmm OK, my bad, every job starts with a clean slate so those commands aren't actually telling us anything meaningful.

Since there's no public logs, you will need to look into them yourself, there isn't too much I can do to help. The Action's entrypoint.sh clones that repository, but I assume for some reason this does not work.

The logs will look something like this but for your own repository:

Cloning into 'platisd/duplicate-code-detection-tool'...
From https://github.com/platisd/duplicate-code-detection-tool
 * [new ref]         refs/pull/33/head -> pull_request_branch
Switched to branch 'pull_request_branch'
{
    "duplicate_code_detection.py": {
        "run_action.py": 16.05
    },
    "run_action.py": {
        "duplicate_code_detection.py": 16.05
    }
}