Skip to content

Commit

Permalink
[FIX] false failures when detecting unreleased dependencies
Browse files Browse the repository at this point in the history
The interpreter is launched with `-e` option, which makes bash fail as soon as one command fails.

The grep command will fail when there's no match. That's a valid use case, and means that there are no unreleased dependencies (or no dependencies).
  • Loading branch information
yajo committed Feb 9, 2022
1 parent eeddf39 commit 45f7cf8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ jobs:
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
result=0
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
grep "^[^#].*/" ${reqfile}
if [ $? -eq 0 ] ; then
grep "^[^#].*/" ${reqfile} || result=$?
if [ $result -eq 0 ] ; then
echo "Unreleased dependencies found in ${reqfile}."
exit 1
fi
Expand Down

0 comments on commit 45f7cf8

Please sign in to comment.