Skip to content

Commit 45f7cf8

Browse files
committed
[FIX] false failures when detecting unreleased dependencies
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).
1 parent eeddf39 commit 45f7cf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/.github/workflows/{% if ci == 'GitHub' %}test.yml{% endif %}.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ jobs:
3737
- run: |
3838
for reqfile in requirements.txt test-requirements.txt ; do
3939
if [ -f ${reqfile} ] ; then
40+
result=0
4041
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
41-
grep "^[^#].*/" ${reqfile}
42-
if [ $? -eq 0 ] ; then
42+
grep "^[^#].*/" ${reqfile} || result=$?
43+
if [ $result -eq 0 ] ; then
4344
echo "Unreleased dependencies found in ${reqfile}."
4445
exit 1
4546
fi

0 commit comments

Comments
 (0)