Skip to content

Commit b52666e

Browse files
authored
build(jscpd): disable jscpd CI Task (#6116)
## Problem ## Solution Disable the task for now. --- <!--- REMINDER: Ensure that your PR meets the guidelines in CONTRIBUTING.md --> License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5766e4b commit b52666e

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed
Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
1-
# github actions: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs
2-
# setup-node: https://github.com/actions/setup-node
1+
# # github actions: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs
2+
# # setup-node: https://github.com/actions/setup-node
33

4-
name: Copy-Paste Detection
4+
# name: Copy-Paste Detection
55

6-
on:
7-
pull_request:
8-
branches: [master, feature/*, staging]
6+
# on:
7+
# pull_request:
8+
# branches: [master, feature/*, staging]
99

10-
jobs:
11-
jscpd:
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
node-version: [18.x]
16-
env:
17-
NODE_OPTIONS: '--max-old-space-size=8192'
10+
# jobs:
11+
# jscpd:
12+
# runs-on: ubuntu-latest
13+
# strategy:
14+
# matrix:
15+
# node-version: [18.x]
16+
# env:
17+
# NODE_OPTIONS: '--max-old-space-size=8192'
1818

19-
steps:
20-
- uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
19+
# steps:
20+
# - uses: actions/checkout@v4
21+
# with:
22+
# fetch-depth: 0
2323

24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: ${{ matrix.node-version }}
24+
# - name: Use Node.js ${{ matrix.node-version }}
25+
# uses: actions/setup-node@v4
26+
# with:
27+
# node-version: ${{ matrix.node-version }}
2828

29-
- name: Fetch fork upstream
30-
run: |
31-
git remote add forkUpstream https://github.com/${{ github.event.pull_request.head.repo.full_name }} # URL of the fork
32-
git fetch forkUpstream # Fetch fork
29+
# - name: Fetch fork upstream
30+
# run: |
31+
# git remote add forkUpstream https://github.com/${{ github.event.pull_request.head.repo.full_name }} # URL of the fork
32+
# git fetch forkUpstream # Fetch fork
3333

34-
- name: Determine base and target branches for comparison.
35-
run: |
36-
echo "CURRENT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
37-
echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
38-
- run: git diff --name-only origin/$TARGET_BRANCH forkUpstream/$CURRENT_BRANCH > diff_output.txt
39-
- run: |
40-
npm install -g jscpd
34+
# - name: Determine base and target branches for comparison.
35+
# run: |
36+
# echo "CURRENT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
37+
# echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
38+
# - run: git diff --name-only origin/$TARGET_BRANCH forkUpstream/$CURRENT_BRANCH > diff_output.txt
39+
# - run: |
40+
# npm install -g jscpd
4141

42-
- run: jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
42+
# - run: jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
4343

44-
- if: always()
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: unfiltered-jscpd-report
48-
path: ./jscpd-report.json
44+
# - if: always()
45+
# uses: actions/upload-artifact@v4
46+
# with:
47+
# name: unfiltered-jscpd-report
48+
# path: ./jscpd-report.json
4949

50-
- name: Filter jscpd report for changed files
51-
run: |
52-
if [ ! -f ./jscpd-report.json ]; then
53-
echo "jscpd-report.json not found"
54-
exit 1
55-
fi
56-
echo "Filtering jscpd report for changed files..."
57-
CHANGED_FILES=$(jq -R -s -c 'split("\n")[:-1]' diff_output.txt)
58-
echo "Changed files: $CHANGED_FILES"
59-
jq --argjson changed_files "$CHANGED_FILES" '
60-
.duplicates | map(select(
61-
(.firstFile?.name as $fname | $changed_files | any(. == $fname)) or
62-
(.secondFile?.name as $sname | $changed_files | any(. == $sname))
63-
))
64-
' ./jscpd-report.json > filtered-jscpd-report.json
65-
cat filtered-jscpd-report.json
50+
# - name: Filter jscpd report for changed files
51+
# run: |
52+
# if [ ! -f ./jscpd-report.json ]; then
53+
# echo "jscpd-report.json not found"
54+
# exit 1
55+
# fi
56+
# echo "Filtering jscpd report for changed files..."
57+
# CHANGED_FILES=$(jq -R -s -c 'split("\n")[:-1]' diff_output.txt)
58+
# echo "Changed files: $CHANGED_FILES"
59+
# jq --argjson changed_files "$CHANGED_FILES" '
60+
# .duplicates | map(select(
61+
# (.firstFile?.name as $fname | $changed_files | any(. == $fname)) or
62+
# (.secondFile?.name as $sname | $changed_files | any(. == $sname))
63+
# ))
64+
# ' ./jscpd-report.json > filtered-jscpd-report.json
65+
# cat filtered-jscpd-report.json
6666

67-
- name: Check for duplicates
68-
run: |
69-
if [ $(wc -l < ./filtered-jscpd-report.json) -gt 1 ]; then
70-
echo "filtered_report_exists=true" >> $GITHUB_ENV
71-
else
72-
echo "filtered_report_exists=false" >> $GITHUB_ENV
73-
fi
74-
- name: upload filtered report (if applicable)
75-
if: env.filtered_report_exists == 'true'
76-
uses: actions/upload-artifact@v4
77-
with:
78-
name: filtered-jscpd-report
79-
path: ./filtered-jscpd-report.json
67+
# - name: Check for duplicates
68+
# run: |
69+
# if [ $(wc -l < ./filtered-jscpd-report.json) -gt 1 ]; then
70+
# echo "filtered_report_exists=true" >> $GITHUB_ENV
71+
# else
72+
# echo "filtered_report_exists=false" >> $GITHUB_ENV
73+
# fi
74+
# - name: upload filtered report (if applicable)
75+
# if: env.filtered_report_exists == 'true'
76+
# uses: actions/upload-artifact@v4
77+
# with:
78+
# name: filtered-jscpd-report
79+
# path: ./filtered-jscpd-report.json
8080

81-
- name: Fail and log found duplicates.
82-
if: env.filtered_report_exists == 'true'
83-
run: |
84-
cat ./filtered-jscpd-report.json
85-
echo "Duplications found, failing the check."
86-
exit 1
81+
# - name: Fail and log found duplicates.
82+
# if: env.filtered_report_exists == 'true'
83+
# run: |
84+
# cat ./filtered-jscpd-report.json
85+
# echo "Duplications found, failing the check."
86+
# exit 1

0 commit comments

Comments
 (0)