29 lines
737 B
YAML

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: phpcsfixer
spec:
description: PHP-CS-Fixer on modified code
workspaces:
- name: source
- name: config
steps:
- name: exec
image: ghcr.io/php-cs-fixer/php-cs-fixer:3-php8.3
command:
- /bin/sh
args:
- '-c'
- |
#set -e
cd $(workspaces.source.path)
echo ""
echo "== RUN PHP-CS-FIXER ======================================"
EXTRA_ARGS=$(printf -- '--path-mode=intersection -- %s' "${CHANGED_FILES}")
php-cs-fixer fix --dry-run --config=$(workspaces.config.path)/php-cs-fixer.dist.php ${EXTRA_ARGS} > temp_phpcsfixer.txt 2>&1
cat temp_phpcsfixer.txt
echo ""
echo ""