rename script

This commit is contained in:
Philip Korsholm
2021-10-20 16:12:44 +02:00
parent 6537e30251
commit b32c6f15ec
3 changed files with 9 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ jobs:
cache: "yarn"
- name: Assert changed
run: ./scripts/assert-changed-files.sh "packages"
run: ./scripts/assert-changed-files-actions.sh "packages"
- name: Bootstrap packages
uses: ./.github/actions/cache-bootstrap

View File

@@ -21,11 +21,15 @@ if [ "$IS_CI" = true ]; then
git config --local --unset url."https://github.com/".insteadOf
fi
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r "$CIRCLE_BRANCH" origin/master | grep -E "$GREP_PATTERN" -c)"
# Make sure that we are diffing towards the right branch, in github actions this is different
# depending on whether or not we are creating a pull request or not.
[ ! -z ${GITHUB_BASE_REF} ] && HAS_BASE=true || HAS_BASE=false
[ HAS_BASE = true ] && COMPARE="${GITHUB_BASE_REF#refs/heads/}" || COMPARE="develop"
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r origin/"$COMPARE" | grep -E "$GREP_PATTERN" -c)"
if [ "$IS_CI" = true ]; then
# reset to previous state
git reset --hard $CIRCLE_SHA1
git reset --hard $GITHUB_SHA
fi
if [ "$FILES_COUNT" -eq 0 ]; then

8
scripts/assert-changed-files.sh Normal file → Executable file
View File

@@ -21,15 +21,11 @@ if [ "$IS_CI" = true ]; then
git config --local --unset url."https://github.com/".insteadOf
fi
# Make sure that we are diffing towards the right branch, in github actions this is different
# depending on whether or not we are creating a pull request or not.
[ ! -z ${GITHUB_BASE_REF} ] && HAS_BASE=true || HAS_BASE=false
[ HAS_BASE = true ] && COMPARE="${GITHUB_BASE_REF#refs/heads/}" || COMPARE="develop"
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r origin/"$COMPARE" | grep -E "$GREP_PATTERN" -c)"
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r "$CIRCLE_BRANCH" origin/master | grep -E "$GREP_PATTERN" -c)"
if [ "$IS_CI" = true ]; then
# reset to previous state
git reset --hard $GITHUB_SHA
git reset --hard $CIRCLE_SHA1
fi
if [ "$FILES_COUNT" -eq 0 ]; then