Skip to content

Commit

Permalink
Fix failure if there are no matching labels
Browse files Browse the repository at this point in the history
If there are no matching labels, grep will exit with a non-zero status,
and since the script is running with `set -e`, this causes it to fail.
  • Loading branch information
Marcelo E. Magallon authored and mem committed Oct 22, 2019
1 parent 5d0f128 commit 0480a7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ x-run:
curl -s "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${CIRCLE_PR_NUMBER}" > "${pull_info_file}"
E2E_LABELS=$(jq -r '.labels[].name' < "${pull_info_file}" | grep --line-regexp --fixed-strings ci:e2e)
# Keep the matching lines instead of simply looking at the exit
# code for debugging purposes
E2E_LABELS=$(jq -r '.labels[].name' < "${pull_info_file}" | grep --line-regexp --fixed-strings ci:e2e || true)
if test -n "${E2E_LABELS}" ; then
echo "Honoring request to run E2E tests from pull request labels"
Expand Down

0 comments on commit 0480a7d

Please sign in to comment.