Skip to content

Commit 2693cfa

Browse files
committed
fix(ci3): GITHUB_REPOSITORY unbound when running ci.sh/bootstrap_ec2 locally
The repo-scoped instance name added `repo=${GITHUB_REPOSITORY##*/}` followed by `repo=${repo:-aztec-packages}`. Under `set -u` (set by ci3/source), the `##*/` expansion on an unset GITHUB_REPOSITORY aborts before the default on the next line applies — so any local `./ci.sh <cmd>` fails with "GITHUB_REPOSITORY: unbound variable". It only surfaced locally; CI always has GITHUB_REPOSITORY set. Default first, then strip: `repo=${GITHUB_REPOSITORY:-aztec-packages}; repo=${repo##*/}`. Same fix in ci.sh and ci3/bootstrap_ec2.
1 parent fa06339 commit 2693cfa

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ function print_usage {
5555

5656
# Keep this in sync with bootstrap_ec2's instance_name scheme (repo-scoped) so the
5757
# shell/kill/get-ip helpers find instances launched by a CI run for this repo.
58-
repo=${GITHUB_REPOSITORY##*/}
59-
repo=${repo:-aztec-packages}
58+
repo=${GITHUB_REPOSITORY:-aztec-packages}
59+
repo=${repo##*/}
6060
instance_name=${INSTANCE_NAME:-${repo}_$(echo -n "$BRANCH" | tr -c 'a-zA-Z0-9-' '_')_${arch}}
6161
[ -n "${INSTANCE_POSTFIX:-}" ] && instance_name+="_$INSTANCE_POSTFIX"
6262

ci3/bootstrap_ec2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ fi
7171
# the same tag/ref concurrently under the same role, and must not reap each
7272
# other's instances. The key stays stable across re-runs within a repo, so the
7373
# orphan cleanup still works.
74-
repo=${GITHUB_REPOSITORY##*/}
75-
repo=${repo:-aztec-packages}
74+
repo=${GITHUB_REPOSITORY:-aztec-packages}
75+
repo=${repo##*/}
7676
if [[ "$REF_NAME" =~ ^gh-readonly-queue/.*(pr-[0-9]+) ]]; then
7777
instance_name="${repo}_${BASH_REMATCH[1]}_$arch"
7878
else

0 commit comments

Comments
 (0)