Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasHT22 authored Dec 19, 2023
2 parents 11ce106 + 100d1ed commit db21111
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/check_plagiarism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ on:
paths:
- "games/**/*.js"

permissions:
contents: read
issues: write
pull-requests: write
permissions: write-all

jobs:
plagiarism-check:
Expand All @@ -30,17 +27,23 @@ jobs:
run: pip install compare50 beautifulsoup4

- name: Get list of changed files
id: changed-files
run: |
base_sha="${{ github.event.pull_request.base.sha }}"
head_sha="${{ github.event.pull_request.head.sha }}"
base_sha="${{ github.base_ref }}"
head_sha="${{ github.sha }}"
js_files=$(git diff --name-only --diff-filter=AM $base_sha..$head_sha | grep 'games/.*\.js$' | xargs)
echo "FILES=$js_files" >> $GITHUB_ENV
echo "Detected JS files: $js_files"
- name: Run Plagiarism Detection Script
env:
FILES: ${{ env.FILES }}
run: python .github/scripts/plagiarism_check.py $FILES games output_dir saved_dir
run: |
IFS=' ' read -ra FILES_ARRAY <<< "$FILES"
for FILE in "${FILES_ARRAY[@]}"; do
echo "Processing file: $FILE"
python .github/scripts/plagiarism_check.py "$FILE" games output_dir saved_dir
done
shell: /usr/bin/bash -e {0}

- name: Extract and Display Similarity Percentages
run: python .github/scripts/extract_percentages.py saved_dir/
Expand Down

0 comments on commit db21111

Please sign in to comment.