Compare commits

...

1 Commits

Author SHA1 Message Date
Dan Stillman 0c062910ac WIP 2021-01-30 08:56:26 -05:00
2 changed files with 16 additions and 9 deletions

View File

@ -36,13 +36,20 @@ get_translators_to_check() {
TRANSLATORS_TO_CHECK="" TRANSLATORS_TO_CHECK=""
# Gets parent commits. Either one or two hashes # Push to master
local parent_commits=($(git show --no-patch --format="%P" HEAD)) if [ "${GITHUB_REF:-}" = "refs/heads/master" ]; then
# Size of $parent_commits array local before_commit=$(jq -r '.before' $(echo $GITHUB_EVENT_PATH))
local num_parent_commits=${#parent_commits[@]} TRANSLATORS_TO_CHECK=$(git diff $before_commit --name-only | grep -e "^[^/]*.js$")
if [ $num_parent_commits -gt 1 ]; then # Pull request
TRANSLATORS_TO_CHECK=$(git diff HEAD^2 $(git rev-list "$(git rev-list --first-parent ^origin/master HEAD^2 | tail -n1)^^!") --name-only | grep -e "^[^/]*.js$")
else else
TRANSLATORS_TO_CHECK=$(git diff $(git rev-list "$(git rev-list --first-parent ^origin/master HEAD | tail -n1)^^!") --name-only | grep -e "^[^/]*.js$") # Gets parent commits. Either one or two hashes
local parent_commits=($(git show --no-patch --format="%P" HEAD))
# Size of $parent_commits array
local num_parent_commits=${#parent_commits[@]}
if [ $num_parent_commits -gt 1 ]; then
TRANSLATORS_TO_CHECK=$(git diff HEAD^2 $(git rev-list "$(git rev-list --first-parent ^origin/master HEAD^2 | tail -n1)^^!") --name-only | grep -e "^[^/]*.js$")
else
TRANSLATORS_TO_CHECK=$(git diff $(git rev-list "$(git rev-list --first-parent ^origin/master HEAD | tail -n1)^^!") --name-only | grep -e "^[^/]*.js$")
fi
fi fi
} }

View File

@ -40,8 +40,8 @@ jobs:
- name: Install node packages - name: Install node packages
run: npm ci run: npm ci
#- name: Debugging with tmate - name: Debugging with tmate
# uses: mxschmitt/action-tmate@v3.1 uses: mxschmitt/action-tmate@v3.1
- name: Lint - name: Lint
run: ./lint.sh run: ./lint.sh