Skip to content

Commit 13afbf1

Browse files
committed
Reject PRs that modify generated files
1 parent 01e4186 commit 13afbf1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

testing/run_travis_tests.sh

+15
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ fi
1111

1212
BRANCH="$TRAVIS_BRANCH"
1313

14+
if [ -n "$IS_PULL_REQUEST" ]; then
15+
changed_files="$(git diff --name-only $BRANCH...HEAD)"
16+
17+
echo "Changed files in this pull request:"
18+
echo "${changed_files}"
19+
echo
20+
21+
if echo "${changed_files}" | grep -q '^[0-9]\+\.[0-9]\+/'; then
22+
echo 'error: generated files in x.y/ directories should not be modified.'
23+
exit 1
24+
fi
25+
fi
26+
1427
if [ -z "$IS_PULL_REQUEST" ] && [ "$BRANCH" = "master" ]; then
1528
# Test all images on master
1629
smoke_test_all_images
@@ -19,3 +32,5 @@ else
1932
# For pull requests and branches, test one image
2033
smoke_test_one_image
2134
fi
35+
36+
# vim: et ts=2 sw=2

0 commit comments

Comments
 (0)