Skip to content

Commit 38468ae

Browse files
committed
reorder steps
1 parent 97f14dd commit 38468ae

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/node.js.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,11 @@ jobs:
3737
with:
3838
node-version: '18'
3939

40-
- name: Install dependencies
41-
run: |
42-
npm install -g jscpd diff-so-fancy
43-
44-
- name: Run jscpd on entire codebase
45-
run: jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
46-
4740
- name: Set up Git
4841
run: |
4942
# Add the main repository as a remote
50-
git remote add upstream https://github.com/${{ github.event.repository.full_name }} # URL of the main repo
51-
git fetch upstream # Fetch the branches from the main repo
43+
git remote add forkUpstream https://github.com/${{ github.event.pull_request.head.repo.full_name }} # URL of the fork
44+
git fetch forkUpstream # Fetch fork
5245
5346
- name: Get current branch and target branch
5447
id: get_branches
@@ -61,7 +54,14 @@ jobs:
6154
echo "TARGET_BRANCH=master" >> $GITHUB_ENV # Default target branch
6255
fi
6356
- name: Get the diff
64-
run: git diff --name-only upstream/$TARGET_BRANCH...$CURRENT_BRANCH > diff_output.txt
57+
run: git diff --name-only origin/$TARGET_BRANCH forkUpstream/$CURRENT_BRANCH > diff_output.txt
58+
59+
- name: Install dependencies
60+
run: |
61+
npm install -g jscpd diff-so-fancy
62+
63+
- name: Run jscpd on entire codebase
64+
run: jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
6565

6666
- name: Upload unfiltered jscpd report
6767
if: always()

0 commit comments

Comments
 (0)