Commit 0193510
authored
fix(ci3): GITHUB_REPOSITORY unbound when running ci.sh locally (#24059)
## Regression
The cross-repo instance-name fix (#23987) added to `ci.sh` and
`ci3/bootstrap_ec2`:
```sh
repo=${GITHUB_REPOSITORY##*/}
repo=${repo:-aztec-packages}
```
Under `set -u` (set by `ci3/source`), the `##*/` expansion on an
**unset** `GITHUB_REPOSITORY` aborts *before* the `:-aztec-packages`
default on the next line can apply. So any local invocation fails
immediately:
```
$ ./ci.sh bench
./ci.sh: line 58: GITHUB_REPOSITORY: unbound variable
```
It only bit locally — CI always has `GITHUB_REPOSITORY` set, so it
passed there.
## Fix
Default first, then strip:
```sh
repo=${GITHUB_REPOSITORY:-aztec-packages}
repo=${repo##*/}
```
Applied in both `ci.sh` and `ci3/bootstrap_ec2`. Verified under `set -u`
with the var unset: resolves to `aztec-packages` (and
`AztecProtocol/aztec-packages` → `aztec-packages` when set), so the
instance-name scheme is unchanged.2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments