Switch to a variable observed in practice

There is apparently no CIRCLE_PR_REPONAME set in the runtime environment,
either, despite what the docs say.
This commit is contained in:
Jean-Paul Calderone 2022-12-21 06:47:21 -05:00
parent 21af00bf83
commit 25eb3ca262

View File

@ -7,7 +7,7 @@ function cache_if_able() {
# We can only *push* to it if we have a CACHIX_AUTH_TOKEN, though.
# in-repo jobs will get this from CircleCI configuration but jobs from
# forks may not.
echo "Building PR from repo: ${CIRCLE_PR_REPONAME}"
echo "Building PR from user/org: ${CIRCLE_PROJECT_USERNAME}"
if [ -v CACHIX_AUTH_TOKEN ]; then
echo "Cachix credentials present; will attempt to write to cache."
cachix watch-exec "${CACHIX_NAME}" -- "$@"
@ -15,7 +15,7 @@ function cache_if_able() {
# If we're building a from a forked repository then we're allowed to
# not have the credentials (but it's also fine if the owner of the
# fork supplied their own).
if [ "${CIRCLE_PR_REPONAME}" == "https://github.com/tahoe-lafs/tahoe-lafs" ]; then
if [ "${CIRCLE_PROJECT_USERNAME}" == "tahoe-lafs" ]; then
echo "Required credentials (CACHIX_AUTH_TOKEN) are missing."
return 1
else