]> git.mxchange.org Git - friendica-addons.git/commitdiff
Fixing CI Changed_Files
authorPhilipp <admin@philipp.info>
Thu, 6 Jan 2022 22:11:59 +0000 (23:11 +0100)
committerPhilipp <admin@philipp.info>
Thu, 6 Jan 2022 22:11:59 +0000 (23:11 +0100)
.woodpecker/.code_standards_check.yml

index df81376f9b7a46d586f286c19ed50244275771de..069e96572d2252d5c6f6127cd6b1e15ef6c9961b 100644 (file)
@@ -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: