[Sprig App] Bomb #2326
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |