File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4444 - name : Run jscpd on entire codebase
4545 run : jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
4646
47+ - name : Get current branch and target branch
48+ id : get_branches
49+ run : |
50+ if [ "${{ github.event_name }}" == "pull_request" ]; then
51+ echo "CURRENT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
52+ echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
53+ else
54+ echo "CURRENT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
55+ echo "TARGET_BRANCH=master" >> $GITHUB_ENV # Default target branch
56+ fi
4757 - name : Get the diff
48- run : git diff --name-only origin/${{ github.event.pull_request.base.ref }}..${{ github.head_ref }} > > diff_output.txt
58+ run : git diff --name-only origin/$TARGET_BRANCH $CURRENT_BRANCH > diff_output.txt
4959
5060 - name : Upload unfiltered jscpd report
5161 if : always()
You can’t perform that action at this time.
0 commit comments