Teach ci/init-external-repos.sh to consider user permissions

Any errors while setting up external/private test repo should fail the
task for PRs submitted by a user with write/admin permission.
This commit is contained in:
Jon Siwek 2021-03-31 10:29:17 -07:00
parent f75da8bb08
commit ade37c1dfc
3 changed files with 15 additions and 2 deletions

View file

@ -39,7 +39,13 @@ if [[ -n "${CIRRUS_CI}" ]] && [[ ! -d zeek-testing-private ]]; then
# the key is also available in PRs for people with write access to the
# repo, so we can still try for those cases).
if [[ -n "${CIRRUS_PR}" ]]; then
set +e
if [[ "${CIRRUS_USER_PERMISSION}" == "write" ]]; then
set -e
elif [[ "${CIRRUS_USER_PERMISSION}" == "admin" ]]; then
set -e
else
set +e
fi
else
set -e
fi