Skip to content

Commit e866adb

Browse files
authored
Merge pull request #170 from snyk/fix/grep-error
fix: prevent grep with no matches from failing the build
2 parents f98ee92 + 66fba6f commit e866adb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/publish-gh-pages.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ echo waiting for the new release to appear in github
4646
attempts=60
4747
sleep_time=10
4848
for (( i=0; i<${attempts}; i++ )); do
49-
count=$(curl -s https://snyk.github.io/kubernetes-monitor/snyk-monitor/values.yaml | grep --line-buffered -c "tag: ${NEW_TAG}")
49+
# Notice we must use "|| :" at the end of grep because when it doesn't find a match
50+
# it returns an exit code 1, which trips this script (it has "set -e").
51+
count=$(curl -s https://snyk.github.io/kubernetes-monitor/snyk-monitor/values.yaml | grep --line-buffered -c "tag: ${NEW_TAG}" || :)
5052
if [[ "$count" == "1" ]]; then
5153
attempts=${i}
5254
break

0 commit comments

Comments
 (0)