1111 required : false
1212 type : ' string'
1313 default : ' latest'
14+ old-branch :
15+ description : ' Whether this is an old branch that runs phpcbf instead of phpcs'
16+ required : false
17+ type : ' boolean'
18+ default : false
1419
1520jobs :
1621 # Runs the PHP coding standards checks.
4247 show-progress : ${{ runner.debug == '1' && 'true' || 'false' }}
4348
4449 - name : Set up PHP
45- uses : shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0
50+ uses : shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
4651 with :
4752 php-version : ${{ inputs.php-version }}
4853 coverage : none
5560 run : echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
5661
5762 - name : Cache PHPCS scan cache
58- uses : actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
63+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
5964 with :
6065 path : |
6166 .cache/phpcs-src.json
7479
7580 - name : Run PHPCS on all Core files
7681 id : phpcs-core
82+ if : ${{ ! inputs.old-branch }}
7783 run : phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml
7884
7985 - name : Show PHPCS results in PR
@@ -82,11 +88,16 @@ jobs:
8288
8389 - name : Check test suite files for warnings
8490 id : phpcs-tests
91+ if : ${{ ! inputs.old-branch }}
8592 run : phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml
8693
8794 - name : Show test suite scan results in PR
8895 if : ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
8996 run : cs2pr ./.cache/phpcs-tests-report.xml
9097
98+ - name : Run PHPCBF on all Core files (old branches)
99+ if : ${{ inputs.old-branch }}
100+ run : phpcbf
101+
91102 - name : Ensure version-controlled files are not modified during the tests
92103 run : git diff --exit-code
0 commit comments