forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a build check for PRs (AssemblyScript#51)
This now checks that distribution files are unmodified and fails otherwise. Also checks if the author is present in the NOTICE file and prints the result, but as email addresses may vary, does not hard-fail.
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
bin/asc text eol=lf | ||
dist/asc.js -diff | ||
dist/assemblyscript.js -diff | ||
scripts/check-pr.sh eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Distribution files should not be modified | ||
STATUS=0 | ||
if git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $TRAVIS_BRANCH) | grep -q "^dist/"; then | ||
STATUS=1 && | ||
printf "\n" && | ||
printf "The pull request includes changes to distribution files, but it shouldn't.\n" && | ||
printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n"; | ||
else | ||
printf "\n" && | ||
printf "GOOD: The pull request does not include changes to distribution files.\n"; | ||
fi | ||
|
||
# Authors should have added themself to the NOTICE file | ||
AUTHOR=$(git log -1 --format="%aE") | ||
if [ -z "$AUTHOR" ]; then | ||
printf "\n" && | ||
printf "Skipping NOTICE check: Commit does not include an email address.\n"; | ||
else | ||
if grep -q "$AUTHOR" NOTICE; then | ||
printf "\n" && | ||
printf "GOOD: Author is present in the NOTICE file.\n"; | ||
else | ||
printf "\n" && | ||
printf "Author does not appear to be listed in the NOTICE file, yet.\n" && | ||
printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n"; | ||
fi | ||
fi | ||
|
||
exit $STATUS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters