]> git.mxchange.org Git - friendica.git/commitdiff
Fixed CHANGED_FILES
authorPhilipp <admin@philipp.info>
Thu, 6 Jan 2022 21:31:55 +0000 (22:31 +0100)
committerPhilipp <admin@philipp.info>
Thu, 6 Jan 2022 22:05:59 +0000 (23:05 +0100)
.woodpecker/.code_standards_check.yml
.woodpecker/.license_check.yml

index d348b41af5696ae99432db1b0d8fd11782146809..f81ab960f72b24487bb20ce6b0f8370d99ebc507 100644 (file)
@@ -29,5 +29,10 @@ pipeline:
   check:
     image: friendicaci/php-cs
     commands:
-      - export CHANGED_FILES="$(git diff --name-status ${CI_PREV_COMMIT_SHA}..${CI_COMMIT_SHA} | grep ^A | cut -f2)"
+      - 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)";
+        else
+          export CHANGED_FILES="$(git diff --name-status ${CI_COMMIT_SHA} | grep ^A | cut -f2)";
+        fi
       - /check-php-cs.sh
index a22c6067e3489551ca0a498818d61f79432ae44f..777986544a0c72e117847f605b8b6a56fe4f95f2 100644 (file)
@@ -2,5 +2,10 @@ pipeline:
   check:
     image: friendicaci/php-cs
     commands:
-      - export CHANGED_FILES="$(git diff --name-status ${CI_PREV_COMMIT_SHA}..${CI_COMMIT_SHA} | grep -i '\.php$' | cut -f2)"
+      - 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 -i '\.php$' | cut -f2)";
+        else
+          export CHANGED_FILES="$(git diff --name-status ${CI_COMMIT_SHA} | grep -i '\.php$' | cut -f2)";
+        fi
       - /check-license.sh