mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 21:04:55 +02:00
build(tools): install playwright deps only when that needs no prompt (#39905)
On Debian/Ubuntu outside GitHub Actions, `tools/playwright.sh` always ran `pnpm exec playwright install --with-deps`. Installing system packages needs root: when it isn't root, Playwright tries `sudo` and falls back to `su`, so a non-root user without passwordless sudo sees `make playwright` — and the targets depending on it, `make test-e2e` and `make test-frontend` — either stop and ask for the root password mid-build or fail outright with `su: System error`. Related: #38860, which added this script. --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
1 parent
3a70b85220
commit
4bbe1b918a
1 file changed
+6
-1
+6
-1
@@ -3,7 +3,12 @@ set -euo pipefail
|
||||
|
||||
# playwright only supports ubuntu/debian officially, and on CI VMs its system deps are pre-installed
|
||||
if [ -z "${GITHUB_ACTIONS:-}" ] && [ "$(uname -s)" = "Linux" ] && grep -qE '^ID(_LIKE)?=.*(ubuntu|debian)' /etc/os-release 2>/dev/null; then
|
||||
pnpm exec playwright install --with-deps "$@"
|
||||
if [ "$(id -u)" = 0 ] || { command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; }; then # Avoid Playwright's interactive su fallback.
|
||||
pnpm exec playwright install --with-deps "$@"
|
||||
else
|
||||
pnpm exec playwright install "$@"
|
||||
echo "Skipped playwright system dependencies (not root and no passwordless sudo), install them with: pnpm exec playwright install-deps" >&2
|
||||
fi
|
||||
else
|
||||
pnpm exec playwright install "$@"
|
||||
fi
|
||||
Reference in new issue
Block a user