mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
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>
15 lines
709 B
Bash
Executable File
15 lines
709 B
Bash
Executable File
#!/bin/bash
|
|
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
|
|
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
|