-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
59 lines (54 loc) · 1.57 KB
/
Copy pathaction.yml
File metadata and controls
59 lines (54 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 'ModuleMirror Code Similarity Detector'
description: 'Detect code similarity between projects using Winnowing + AST fingerprints'
branding:
icon: 'search'
color: 'blue'
inputs:
target:
description: 'Target project path or GitHub URL'
required: true
candidates:
description: 'Candidate projects (comma-separated paths or URLs)'
required: true
threshold:
description: 'Similarity threshold (0-100)'
required: false
default: '70'
language:
description: 'Programming language(s) (comma-separated)'
required: false
default: 'python'
output-format:
description: 'Report format (json/html/markdown)'
required: false
default: 'html'
output-path:
description: 'Report output path'
required: false
default: './similarity-report'
runs:
using: 'composite'
steps:
- name: Install ModuleMirror
shell: bash
run: pip install gh-similarity-detector
- name: Run similarity detection
shell: bash
run: |
IFS=',' read -ra CAND <<< "${{ inputs.candidates }}"
CAND_ARGS=""
for c in "${CAND[@]}"; do
CAND_ARGS="$CAND_ARGS -c $c"
done
IFS=',' read -ra LANG <<< "${{ inputs.language }}"
LANG_ARGS=""
for l in "${LANG[@]}"; do
LANG_ARGS="$LANG_ARGS -l $l"
done
gh-sim detect \
-t "${{ inputs.target }}" \
$CAND_ARGS \
$LANG_ARGS \
--threshold ${{ inputs.threshold }} \
--format ${{ inputs.output-format }} \
--output ${{ inputs.output-path }}