Fixed CHANGED_FILES

This commit is contained in:
Philipp Holzer 2022-01-06 22:31:55 +01:00
parent 3e0bcf7acd
commit af135d4ad7
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
2 changed files with 12 additions and 2 deletions

View 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

View 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