Skip to content

Commit

Permalink
Code duplication: Update jscpd.yml to run in repo context (prebid#11757)
Browse files Browse the repository at this point in the history
* Code duplication: Update jscpd.yml to run in repo context

* Update jscpd.yml
  • Loading branch information
patmmccann committed Jun 10, 2024
1 parent 7bdab2b commit 6ba49e6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/jscpd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check for Duplicated Code

on:
pull_request:
pull_request_target:
branches:
- master

Expand Down Expand Up @@ -40,8 +40,13 @@ jobs:
- name: Run jscpd on entire codebase
run: jscpd

- name: Fetch base and target branches
run: |
git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge:refs/remotes/pull/${{ github.event.pull_request.number }}/merge
- name: Get the diff
run: git diff origin/master...HEAD --name-only > changed_files.txt
run: git diff --name-only origin/${{ github.event.pull_request.base.ref }}...refs/remotes/pull/${{ github.event.pull_request.number }}/merge > changed_files.txt

- name: List generated files (debug)
run: ls -l
Expand Down

0 comments on commit 6ba49e6

Please sign in to comment.