-
Notifications
You must be signed in to change notification settings - Fork 1.1k
37 lines (30 loc) · 1.28 KB
/
check_plagiarism.yml
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
name: Plagiarism Checker
on:
pull_request:
paths:
- "games/**/*.js"
jobs:
plagiarism-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install python requirements
run: pip install jsbeautifier nltk argparse
- name: Get list of changed files
id: changed-files
run: |
echo "Pull Request Base SHA: ${{ github.event.pull_request.base.sha }}"
echo "Pull Request Head SHA: ${{ github.event.pull_request.head.sha }}"
git diff --name-only --diff-filter=AM --find-renames --find-copies ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep 'games/.*\.js$' | xargs
js_files=$(git diff --name-only --diff-filter=AM --find-renames --find-copies ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep 'games/.*\.js$' | xargs)
echo "FILES=$js_files" >> $GITHUB_ENV
- name: Run Plagiarism Detection Script
if: env.FILES != ''
run: python ./.github/scripts/plagiarism_check.py games 0.5 "${{ env.FILES }}"