Skip to content

Commit e538bff

Browse files
committed
GA: add phpcpd action
1 parent aa78256 commit e538bff

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/phpcpd.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PHPCPD
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- '.github/workflows/phpcpd.yml'
10+
push:
11+
branches:
12+
- develop
13+
paths:
14+
- '**.php'
15+
- '.github/workflows/phpcpd.yml'
16+
17+
jobs:
18+
build:
19+
name: Code Copy-Paste Detection
20+
runs-on: ubuntu-latest
21+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: '8.0'
31+
tools: phpcpd
32+
extensions: dom, mbstring
33+
coverage: none
34+
35+
- name: Detect duplicate code
36+
run: phpcpd src/ --min-lines 35 --exclude src/Database/Migrations/2022-10-20-182737_ShieldOAuth.php

0 commit comments

Comments
 (0)