Repository navigation
Commit cb89ead
committed
ci: fix pipefail and unauthed mysqladmin in migration job
Two issues caught in review:
1. The pre-flight `count=$(ls ... | wc -l | ...)` runs under the GitHub
Actions default `bash -eo pipefail`. When the glob matches zero
files, ls exits non-zero and pipefail aborts the command
substitution before the custom "no compiled migrations" message can
print. Replaced with a bash array + `shopt -s nullglob`, which
handles both missing-directory and no-matches identically (count=0)
without invoking a pipeline.
2. `mysqladmin ping` without credentials returns exit 0 even when
MySQL replies "Access denied" — so the wait loop terminated as
soon as the TCP port opened, before the auth subsystem was ready,
racing the migration step. Pass MYSQL_PWD via `docker compose exec
-e` and `-uroot` to force a real authenticated ping; exit code is
now non-zero until the server accepts our credentials.1 parent d9c8f2f commit cb89ead
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | | - | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
0 commit comments