File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 6
6
set -euo pipefail
7
7
IFS=$' \n\t '
8
8
9
+ source " $( cd " $( dirname " $0 " ) " && pwd) /../shared.sh"
10
+
11
+ if [[ -z " ${CI_ONLY_WHEN_SUBMODULES_CHANGED+x} " ]]; then
12
+ echo " Executing the job since there is no skip rule in effect"
13
+ exit 0
14
+ fi
15
+
9
16
git fetch " https://github.com/$GITHUB_REPOSITORY " " $GITHUB_BASE_REF "
10
17
BASE_COMMIT=" $( git merge-base FETCH_HEAD HEAD) "
11
18
12
19
echo " Searching for toolstate changes between $BASE_COMMIT and $( git rev-parse HEAD) "
13
- source " $( cd " $( dirname " $0 " ) " && pwd) /../shared.sh"
14
20
15
- if [[ -z " ${CI_ONLY_WHEN_SUBMODULES_CHANGED+x} " ]]; then
16
- echo " Executing the job since there is no skip rule in effect"
17
- elif git diff " $BASE_COMMIT " | grep --quiet " ^index .* 160000" ; then
21
+ if git diff " $BASE_COMMIT " | grep --quiet " ^index .* 160000" ; then
18
22
# Submodules pseudo-files inside git have the 160000 permissions, so when
19
23
# those files are present in the diff a submodule was updated.
20
24
echo " Executing the job since submodules are updated"
21
25
elif git diff --name-only " $BASE_COMMIT " | grep --quiet src/tools/' \(clippy\|rustfmt\)' ; then
22
26
# There is not an easy blanket search for subtrees. For now, manually list
23
- # clippy .
27
+ # the subtrees .
24
28
echo " Executing the job since clippy or rustfmt subtree was updated"
25
29
else
26
- echo " Not executing this job since no submodules were updated"
30
+ echo " Not executing this job since no submodules nor subtrees were updated"
27
31
ciCommandSetEnv SKIP_JOB 1
28
32
fi
You can’t perform that action at this time.
0 commit comments