From d1bac4f620924a72f78faf84f7c92764f53bd182 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 6 Jan 2022 23:11:59 +0100 Subject: [PATCH] Fixing CI Changed_Files --- .woodpecker/.code_standards_check.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.woodpecker/.code_standards_check.yml b/.woodpecker/.code_standards_check.yml index df81376f..069e9657 100644 --- a/.woodpecker/.code_standards_check.yml +++ b/.woodpecker/.code_standards_check.yml @@ -55,7 +55,12 @@ pipeline: image: friendicaci/php-cs commands: - cd addon/ - - export CHANGED_FILES="$(git diff --name-status ${CI_PREV_COMMIT_SHA}..${CI_COMMIT_SHA} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")" + - if [ ! -z "$${CI_COMMIT_PULL_REQUEST}" ]; then + git fetch --no-tags origin ${CI_COMMIT_TARGET_BRANCH}; + export CHANGED_FILES="$(git diff --name-status $(git merge-base FETCH_HEAD origin/${CI_COMMIT_TARGET_BRANCH})..${CI_COMMIT_SHA} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")"; + else + export CHANGED_FILES="$(git diff --name-status ${CI_COMMIT_SHA} | grep ^A | cut -f2 | sed -e "s/^/addon\\//")"; + fi - cd ../ - /check-php-cs.sh when: