rename script
This commit is contained in:
2
.github/workflows/action.yml
vendored
2
.github/workflows/action.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
cache: "yarn"
|
cache: "yarn"
|
||||||
|
|
||||||
- name: Assert changed
|
- name: Assert changed
|
||||||
run: ./scripts/assert-changed-files.sh "packages"
|
run: ./scripts/assert-changed-files-actions.sh "packages"
|
||||||
|
|
||||||
- name: Bootstrap packages
|
- name: Bootstrap packages
|
||||||
uses: ./.github/actions/cache-bootstrap
|
uses: ./.github/actions/cache-bootstrap
|
||||||
|
|||||||
8
scripts/assert-changed-files-circleci.sh → scripts/assert-changed-files-actions.sh
Executable file → Normal file
8
scripts/assert-changed-files-circleci.sh → scripts/assert-changed-files-actions.sh
Executable file → Normal file
@@ -21,11 +21,15 @@ if [ "$IS_CI" = true ]; then
|
|||||||
git config --local --unset url."https://github.com/".insteadOf
|
git config --local --unset url."https://github.com/".insteadOf
|
||||||
fi
|
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
|
if [ "$IS_CI" = true ]; then
|
||||||
# reset to previous state
|
# reset to previous state
|
||||||
git reset --hard $CIRCLE_SHA1
|
git reset --hard $GITHUB_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FILES_COUNT" -eq 0 ]; then
|
if [ "$FILES_COUNT" -eq 0 ]; then
|
||||||
8
scripts/assert-changed-files.sh
Normal file → Executable file
8
scripts/assert-changed-files.sh
Normal file → Executable file
@@ -21,15 +21,11 @@ if [ "$IS_CI" = true ]; then
|
|||||||
git config --local --unset url."https://github.com/".insteadOf
|
git config --local --unset url."https://github.com/".insteadOf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure that we are diffing towards the right branch, in github actions this is different
|
FILES_COUNT="$(git diff-tree --no-commit-id --name-only -r "$CIRCLE_BRANCH" origin/master | grep -E "$GREP_PATTERN" -c)"
|
||||||
# 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
|
if [ "$IS_CI" = true ]; then
|
||||||
# reset to previous state
|
# reset to previous state
|
||||||
git reset --hard $GITHUB_SHA
|
git reset --hard $CIRCLE_SHA1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FILES_COUNT" -eq 0 ]; then
|
if [ "$FILES_COUNT" -eq 0 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user