Skip to content

[Sprig App] papermc #2659

[Sprig App] papermc

[Sprig App] papermc #2659

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 }}"