From 631d89e8f992f81a82f44309ec4eec76ac84bbc1 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 18:21:33 +0900 Subject: [PATCH 1/5] ci: time-limit and retry Playwright installs, cache release-compat apt packages `release-compat` restored its browser cache but still hung in `playwright install --with-deps`: Firefox and WebKit need 185 Ubuntu packages (140 MB) the runner image lacks, and the runner's Ubuntu mirror served them at a few kB/s until the job was cancelled at 30 minutes. Every Playwright install now goes through .github/scripts/install-playwright.sh, which limits each attempt, retries up to three times (downloaded packages are kept, so a retry resumes), and makes apt drop stalled connections. release-compat also keeps the downloaded .deb files in actions/cache, so a normal run installs them without the mirror. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/install-playwright.sh | 79 +++++++++++++++++++++++++++ .github/workflows/publish.yml | 42 ++++++++++++-- 2 files changed, 117 insertions(+), 4 deletions(-) create mode 100755 .github/scripts/install-playwright.sh diff --git a/.github/scripts/install-playwright.sh b/.github/scripts/install-playwright.sh new file mode 100755 index 000000000..b240e76da --- /dev/null +++ b/.github/scripts/install-playwright.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# Installs Playwright browsers and their system packages on a GitHub-hosted +# Ubuntu runner without letting a slow apt mirror hold the job hostage. +# +# install-playwright.sh ... +# +# Environment: +# PLAYWRIGHT_CLI the Playwright CLI to run (default: "bunx playwright") +# ATTEMPT_TIMEOUT the time limit of one attempt (default: 4m) +# ATTEMPTS how many attempts to make (default: 3) +# PLAYWRIGHT_APT_CACHE a directory of .deb files kept between runs by +# actions/cache; seeded into apt before installing and +# refreshed after a successful install (optional) +# +# `playwright install --with-deps` runs `apt-get update` and +# `apt-get install` for the packages the browsers need. Firefox and WebKit +# need about 185 packages (140 MB) the image does not ship, and the Ubuntu +# mirror of the runner sometimes serves them at a few kB/s, so one install +# could run until the job timed out. Each attempt here is time-limited; +# packages downloaded before a timeout stay in /var/cache/apt/archives, so +# the next attempt only fetches the rest. +set -euo pipefail + +if [ "$#" -eq 0 ]; then + echo "usage: $0 ..." >&2 + exit 2 +fi + +read -r -a cli <<< "${PLAYWRIGHT_CLI:-bunx playwright}" +attempt_timeout="${ATTEMPT_TIMEOUT:-4m}" +attempts="${ATTEMPTS:-3}" +apt_cache="${PLAYWRIGHT_APT_CACHE:-}" +apt_cache="${apt_cache/#\~/$HOME}" +archives=/var/cache/apt/archives + +# Keep downloaded packages, retry failed requests and drop stalled +# connections instead of waiting on them, and wait for a dpkg lock left by +# an interrupted attempt rather than failing on it. +sudo tee /etc/apt/apt.conf.d/99-playwright-ci > /dev/null << 'EOF' +APT::Keep-Downloaded-Packages "true"; +Binary::apt::APT::Keep-Downloaded-Packages "true"; +Acquire::Retries "3"; +Acquire::http::Timeout "30"; +Acquire::https::Timeout "30"; +DPkg::Lock::Timeout "120"; +EOF + +if [ -n "$apt_cache" ] && compgen -G "$apt_cache/*.deb" > /dev/null; then + echo "Seeding apt with $(find "$apt_cache" -name '*.deb' | wc -l) cached package(s)" + sudo cp -n "$apt_cache"/*.deb "$archives/" +fi + +attempt=1 +until timeout --kill-after=20s "$attempt_timeout" "${cli[@]}" install --with-deps "$@"; do + status=$? + if [ "$attempt" -ge "$attempts" ]; then + echo "::error::Playwright install failed after $attempt attempt(s) (last exit status $status)" + exit "$status" + fi + echo "::warning::Playwright install attempt $attempt exited with status $status (124 = timed out after $attempt_timeout); retrying" + # A killed attempt can leave apt-get behind sudo or dpkg half-configured. + sudo pkill -KILL -x apt-get || true + sudo dpkg --configure -a || true + echo "Packages already downloaded: $(find "$archives" -maxdepth 1 -name '*.deb' | wc -l)" + attempt=$((attempt + 1)) +done +echo "Playwright installed on attempt $attempt" + +if [ -n "$apt_cache" ]; then + # Keep only packages apt can still use, so the cache does not grow with + # every Ubuntu update. + sudo apt-get autoclean -qq + mkdir -p "$apt_cache" + find "$apt_cache" -name '*.deb' -delete + if compgen -G "$archives/*.deb" > /dev/null; then + cp "$archives"/*.deb "$apt_cache/" + fi + echo "Kept $(find "$apt_cache" -name '*.deb' | wc -l) package(s) for the apt cache" +fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 428d15200..e87858047 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -639,9 +639,14 @@ jobs: with: path: ~/.cache/ms-playwright key: playwright-chromium-${{ runner.os }}-${{ env.RUNNER_IMAGE }}-${{ env.PLAYWRIGHT_REVISIONS }} + # Each attempt is time-limited and retried, so a stalled apt mirror or + # browser download costs minutes instead of the whole job. - &install-chromium name: Install Playwright Browsers - run: bunx playwright install chromium --with-deps + timeout-minutes: 11 + env: + ATTEMPT_TIMEOUT: 3m + run: bash .github/scripts/install-playwright.sh chromium # A run only compares against the screenshots checked into the repository: # it never creates or commits them. A new visual test needs its baselines # generated by a maintainer (`bun run test:e2e:update`) and committed. @@ -954,8 +959,31 @@ jobs: with: path: ~/.cache/ms-playwright key: playwright-release-compat-${{ runner.os }}-${{ env.RUNNER_IMAGE }}-${{ env.PLAYWRIGHT_REVISIONS }} + # Firefox and WebKit need about 140 MB of Ubuntu packages the image does + # not ship. Keeping the .deb files between runs spares the runner's + # Ubuntu mirror, which has served them slowly enough to time the job out. + - name: Record the week for the apt package cache key + run: echo "CACHE_WEEK=$(date -u +%G-W%V)" >> "$GITHUB_ENV" + - name: Restore Playwright system packages + id: restore-playwright-apt + uses: actions/cache/restore@v6 + with: + path: ~/.cache/playwright-apt + key: playwright-apt-release-compat-${{ runner.os }}-${{ env.RUNNER_IMAGE }}-${{ env.PLAYWRIGHT_REVISIONS }}-${{ env.CACHE_WEEK }} + restore-keys: | + playwright-apt-release-compat-${{ runner.os }}-${{ env.RUNNER_IMAGE }}- - name: Install Playwright browsers - run: bunx playwright install chromium firefox webkit --with-deps + timeout-minutes: 14 + env: + ATTEMPT_TIMEOUT: 4m + PLAYWRIGHT_APT_CACHE: ~/.cache/playwright-apt + run: bash .github/scripts/install-playwright.sh chromium firefox webkit + - name: Save Playwright system packages + if: steps.restore-playwright-apt.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: ~/.cache/playwright-apt + key: playwright-apt-release-compat-${{ runner.os }}-${{ env.RUNNER_IMAGE }}-${{ env.PLAYWRIGHT_REVISIONS }}-${{ env.CACHE_WEEK }} - name: Build packed consumers and check production computed styles run: bun run test:release - name: Upload release compatibility evidence @@ -997,12 +1025,18 @@ jobs: # The `build` job's fresh WASM and packages of this commit. - *download-build - *unpack-build - - name: Install latest private Playwright and Chromium + - name: Install latest private Playwright run: | mkdir -p "$DEVUP_PLAYWRIGHT_ROOT" "$DEVUP_EXTENDS_RESULTS" printf '{"private":true,"type":"module"}\n' > "$DEVUP_PLAYWRIGHT_ROOT/package.json" bun add --cwd "$DEVUP_PLAYWRIGHT_ROOT" @playwright/test@latest - node "$DEVUP_PLAYWRIGHT_ROOT/node_modules/@playwright/test/cli.js" install chromium --with-deps + - name: Install Chromium for the private Playwright + timeout-minutes: 14 + env: + ATTEMPT_TIMEOUT: 4m + run: | + PLAYWRIGHT_CLI="node $DEVUP_PLAYWRIGHT_ROOT/node_modules/@playwright/test/cli.js" \ + bash .github/scripts/install-playwright.sh chromium - name: Installed formats and production theme delivery regressions run: | set -euo pipefail From 27783c97eafdade313253c2340452c5119511058 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 18:43:00 +0900 Subject: [PATCH 2/5] ci: prefetch Playwright's apt packages in parallel with fallback mirrors Time-limited retries alone did not get through: the runner's Ubuntu mirror delivered about 12 of 185 packages per 4-minute attempt. install-deps now runs as root with apt-get-prefetch.sh first on PATH, which downloads the packages apt would fetch eight at a time, drops connections slower than 50 kB/s and falls back to archive.ubuntu.com and azure.archive.ubuntu.com, checks each file's hash, and then runs the real apt-get. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/apt-get-prefetch.sh | 50 +++++++++++++++++++++++++++ .github/scripts/install-playwright.sh | 25 ++++++++++++-- 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100755 .github/scripts/apt-get-prefetch.sh diff --git a/.github/scripts/apt-get-prefetch.sh b/.github/scripts/apt-get-prefetch.sh new file mode 100755 index 000000000..abd70a40f --- /dev/null +++ b/.github/scripts/apt-get-prefetch.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# Stands in for apt-get on PATH while `playwright install-deps` runs (see +# install-playwright.sh). For `apt-get install` it first downloads the +# packages apt would fetch, several at a time and from fallback Ubuntu +# mirrors when the runner's mirror is slow, into apt's archive directory; +# then it runs the real apt-get, which finds them already downloaded. +# Anything the prefetch misses, the real apt-get still downloads itself. +set -uo pipefail + +real=/usr/bin/apt-get + +if [ "${1:-}" = install ]; then + archives=/var/cache/apt/archives + mirrors=(${PREFETCH_MIRRORS:-http://archive.ubuntu.com/ubuntu http://azure.archive.ubuntu.com/ubuntu}) + + fetch() { + local url="${1//\'/}" file="$2" hash="$3" + local algo="${hash%%:*}" sum="${hash#*:}" path tmp candidate + [ -s "$archives/$file" ] && return 0 + path="${url#*/ubuntu/}" + tmp="$(mktemp -p "$archives/partial")" + for candidate in "$url" "${mirrors[@]/%//$path}"; do + # Give up on a connection slower than 50 kB/s for 15 s and move on to + # the next mirror. + if curl -fsSL --connect-timeout 10 --speed-limit 51200 --speed-time 15 \ + --max-time 300 -o "$tmp" "$candidate" && + echo "$sum $tmp" | "$(echo "$algo" | tr '[:upper:]' '[:lower:]')sum" --status -c; then + mv "$tmp" "$archives/$file" + return 0 + fi + done + rm -f "$tmp" + echo "prefetch: could not download $file; apt-get will retry it" >&2 + } + export -f fetch + export archives + export PREFETCH_MIRROR_LIST="${mirrors[*]}" + + started=$SECONDS + uris="$("$real" "$@" --print-uris -qq 2> /dev/null | grep "^'" || true)" + count="$(printf '%s' "$uris" | grep -c . || true)" + if [ "$count" -gt 0 ]; then + echo "prefetch: downloading $count package(s), 8 at a time" + printf '%s\n' "$uris" | + xargs -P 8 -L 1 bash -c 'mirrors=($PREFETCH_MIRROR_LIST); fetch "$0" "$1" "$3"' + echo "prefetch: done in $((SECONDS - started))s" + fi +fi + +exec "$real" "$@" diff --git a/.github/scripts/install-playwright.sh b/.github/scripts/install-playwright.sh index b240e76da..8144aa559 100755 --- a/.github/scripts/install-playwright.sh +++ b/.github/scripts/install-playwright.sh @@ -16,7 +16,8 @@ # `apt-get install` for the packages the browsers need. Firefox and WebKit # need about 185 packages (140 MB) the image does not ship, and the Ubuntu # mirror of the runner sometimes serves them at a few kB/s, so one install -# could run until the job timed out. Each attempt here is time-limited; +# could run until the job timed out. Here the packages are downloaded +# several at a time with fallback mirrors, each attempt is time-limited, and # packages downloaded before a timeout stay in /var/cache/apt/archives, so # the next attempt only fetches the rest. set -euo pipefail @@ -27,6 +28,14 @@ if [ "$#" -eq 0 ]; then fi read -r -a cli <<< "${PLAYWRIGHT_CLI:-bunx playwright}" + +# One attempt, run by the retry loop below under `timeout`. +if [ "$1" = --attempt ]; then + shift + sudo env "PATH=$APT_GET_SHIM:$PATH" "${cli[@]}" install-deps "$@" + exec "${cli[@]}" install "$@" +fi + attempt_timeout="${ATTEMPT_TIMEOUT:-4m}" attempts="${ATTEMPTS:-3}" apt_cache="${PLAYWRIGHT_APT_CACHE:-}" @@ -50,16 +59,26 @@ if [ -n "$apt_cache" ] && compgen -G "$apt_cache/*.deb" > /dev/null; then sudo cp -n "$apt_cache"/*.deb "$archives/" fi +# `install-deps` runs as root so Playwright calls apt-get without sudo, which +# would reset PATH; the apt-get on PATH is then apt-get-prefetch.sh, which +# downloads the packages in parallel (with fallback mirrors) before handing +# over to the real apt-get. The browsers install as the runner user. +APT_GET_SHIM="$(mktemp -d)" +export APT_GET_SHIM +ln -s "$(cd "$(dirname "$0")" && pwd)/apt-get-prefetch.sh" "$APT_GET_SHIM/apt-get" + attempt=1 -until timeout --kill-after=20s "$attempt_timeout" "${cli[@]}" install --with-deps "$@"; do +until timeout --kill-after=20s "$attempt_timeout" bash "$0" --attempt "$@"; do status=$? if [ "$attempt" -ge "$attempts" ]; then echo "::error::Playwright install failed after $attempt attempt(s) (last exit status $status)" exit "$status" fi echo "::warning::Playwright install attempt $attempt exited with status $status (124 = timed out after $attempt_timeout); retrying" - # A killed attempt can leave apt-get behind sudo or dpkg half-configured. + # A killed attempt can leave apt-get or its downloads running, or dpkg + # half-configured. sudo pkill -KILL -x apt-get || true + sudo pkill -KILL -x curl || true sudo dpkg --configure -a || true echo "Packages already downloaded: $(find "$archives" -maxdepth 1 -name '*.deb' | wc -l)" attempt=$((attempt + 1)) From 3370edbd1888e7b83ae67cda8fd4f02ade15a89f Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 18:59:00 +0900 Subject: [PATCH 3/5] ci: resolve apt's mirror+file URLs in the Playwright package prefetch The hosted images give apt `mirror+file:/etc/apt/apt-mirrors.txt/...` URIs, which curl cannot fetch, so the prefetch downloaded nothing. Read the mirrors from that list first, then the fallback mirrors, and report how many packages the prefetch got. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/apt-get-prefetch.sh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/scripts/apt-get-prefetch.sh b/.github/scripts/apt-get-prefetch.sh index abd70a40f..5b38c0eb6 100755 --- a/.github/scripts/apt-get-prefetch.sh +++ b/.github/scripts/apt-get-prefetch.sh @@ -15,14 +15,28 @@ if [ "${1:-}" = install ]; then fetch() { local url="${1//\'/}" file="$2" hash="$3" - local algo="${hash%%:*}" sum="${hash#*:}" path tmp candidate + local algo="${hash%%:*}" sum="${hash#*:}" path tmp candidate rest list + local -a bases [ -s "$archives/$file" ] && return 0 - path="${url#*/ubuntu/}" + case "$url" in + # The hosted images point apt at a mirror list: + # mirror+file:/etc/apt/apt-mirrors.txt/pool/main/... + mirror+file:*) + rest="${url#mirror+file:}" + list="${rest%%.txt/*}.txt" + path="${rest#*.txt/}" + mapfile -t bases < <(awk '/^[a-z]+:\/\//{sub(/\/$/, "", $1); print $1}' "$list") + ;; + *) + path="${url#*/ubuntu/}" + bases=("${url%%/ubuntu/*}/ubuntu") + ;; + esac tmp="$(mktemp -p "$archives/partial")" - for candidate in "$url" "${mirrors[@]/%//$path}"; do + for candidate in "${bases[@]/%//$path}" "${mirrors[@]/%//$path}"; do # Give up on a connection slower than 50 kB/s for 15 s and move on to # the next mirror. - if curl -fsSL --connect-timeout 10 --speed-limit 51200 --speed-time 15 \ + if curl -fsL --connect-timeout 10 --speed-limit 51200 --speed-time 15 \ --max-time 300 -o "$tmp" "$candidate" && echo "$sum $tmp" | "$(echo "$algo" | tr '[:upper:]' '[:lower:]')sum" --status -c; then mv "$tmp" "$archives/$file" @@ -43,7 +57,8 @@ if [ "${1:-}" = install ]; then echo "prefetch: downloading $count package(s), 8 at a time" printf '%s\n' "$uris" | xargs -P 8 -L 1 bash -c 'mirrors=($PREFETCH_MIRROR_LIST); fetch "$0" "$1" "$3"' - echo "prefetch: done in $((SECONDS - started))s" + missing="$("$real" "$@" --print-uris -qq 2> /dev/null | grep -c "^'" || true)" + echo "prefetch: $((count - missing)) of $count package(s) downloaded in $((SECONDS - started))s" fi fi From 90d67f7f0997556ec9f016257b2e6452cc587d20 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 19:19:48 +0900 Subject: [PATCH 4/5] ci: check apt's MD5 hashes and time-limit apt inside sudo The prefetch built the checker name from apt's hash label and ran `md5sumsum` for MD5Sum hashes, so it discarded every download. And the `timeout` around `sudo` never reached apt-get, which sudo runs in its own session: a timed-out attempt kept downloading and held the dpkg lock through the next attempt. Map each hash label to its checker, run `timeout` inside sudo, and time-limit the browser download separately. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/apt-get-prefetch.sh | 11 +++++++++-- .github/scripts/install-playwright.sh | 23 ++++++++++++----------- .github/workflows/publish.yml | 2 +- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/scripts/apt-get-prefetch.sh b/.github/scripts/apt-get-prefetch.sh index 5b38c0eb6..2994f3bd6 100755 --- a/.github/scripts/apt-get-prefetch.sh +++ b/.github/scripts/apt-get-prefetch.sh @@ -15,7 +15,7 @@ if [ "${1:-}" = install ]; then fetch() { local url="${1//\'/}" file="$2" hash="$3" - local algo="${hash%%:*}" sum="${hash#*:}" path tmp candidate rest list + local algo="${hash%%:*}" sum="${hash#*:}" path tmp candidate rest list checker local -a bases [ -s "$archives/$file" ] && return 0 case "$url" in @@ -32,13 +32,20 @@ if [ "${1:-}" = install ]; then bases=("${url%%/ubuntu/*}/ubuntu") ;; esac + # apt prints MD5Sum:, SHA1:, SHA256: or SHA512: before the hash. + case "$algo" in + MD5Sum) checker=md5sum ;; + SHA1) checker=sha1sum ;; + SHA256) checker=sha256sum ;; + *) checker=sha512sum ;; + esac tmp="$(mktemp -p "$archives/partial")" for candidate in "${bases[@]/%//$path}" "${mirrors[@]/%//$path}"; do # Give up on a connection slower than 50 kB/s for 15 s and move on to # the next mirror. if curl -fsL --connect-timeout 10 --speed-limit 51200 --speed-time 15 \ --max-time 300 -o "$tmp" "$candidate" && - echo "$sum $tmp" | "$(echo "$algo" | tr '[:upper:]' '[:lower:]')sum" --status -c; then + echo "$sum $tmp" | "$checker" --status -c; then mv "$tmp" "$archives/$file" return 0 fi diff --git a/.github/scripts/install-playwright.sh b/.github/scripts/install-playwright.sh index 8144aa559..3b2a04c67 100755 --- a/.github/scripts/install-playwright.sh +++ b/.github/scripts/install-playwright.sh @@ -29,13 +29,6 @@ fi read -r -a cli <<< "${PLAYWRIGHT_CLI:-bunx playwright}" -# One attempt, run by the retry loop below under `timeout`. -if [ "$1" = --attempt ]; then - shift - sudo env "PATH=$APT_GET_SHIM:$PATH" "${cli[@]}" install-deps "$@" - exec "${cli[@]}" install "$@" -fi - attempt_timeout="${ATTEMPT_TIMEOUT:-4m}" attempts="${ATTEMPTS:-3}" apt_cache="${PLAYWRIGHT_APT_CACHE:-}" @@ -63,12 +56,20 @@ fi # would reset PATH; the apt-get on PATH is then apt-get-prefetch.sh, which # downloads the packages in parallel (with fallback mirrors) before handing # over to the real apt-get. The browsers install as the runner user. -APT_GET_SHIM="$(mktemp -d)" -export APT_GET_SHIM -ln -s "$(cd "$(dirname "$0")" && pwd)/apt-get-prefetch.sh" "$APT_GET_SHIM/apt-get" +shim="$(mktemp -d)" +ln -s "$(cd "$(dirname "$0")" && pwd)/apt-get-prefetch.sh" "$shim/apt-get" + +# One attempt. `timeout` runs inside sudo: sudo starts the command in a +# session of its own, so a `timeout` outside it would not reach apt-get and +# a timed-out attempt would keep holding the dpkg lock. +install_once() { + sudo timeout --kill-after=20s "$attempt_timeout" \ + env "PATH=$shim:$PATH" "${cli[@]}" install-deps "$@" && + timeout --kill-after=20s "$attempt_timeout" "${cli[@]}" install "$@" +} attempt=1 -until timeout --kill-after=20s "$attempt_timeout" bash "$0" --attempt "$@"; do +until install_once "$@"; do status=$? if [ "$attempt" -ge "$attempts" ]; then echo "::error::Playwright install failed after $attempt attempt(s) (last exit status $status)" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e87858047..56cfac0c7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -643,7 +643,7 @@ jobs: # browser download costs minutes instead of the whole job. - &install-chromium name: Install Playwright Browsers - timeout-minutes: 11 + timeout-minutes: 14 env: ATTEMPT_TIMEOUT: 3m run: bash .github/scripts/install-playwright.sh chromium From 65de9a9a0047aa81595eff512d55ae50b1fbc470 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Thu, 19 Nov 2026 19:40:32 +0900 Subject: [PATCH 5/5] ci: keep prefetched apt packages readable for the cache mktemp creates the prefetched .deb files with mode 0600, so copying them into the actions/cache directory as the runner user failed. Make them 0644 like apt's own downloads, and copy the cache as root and hand it back. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/apt-get-prefetch.sh | 1 + .github/scripts/install-playwright.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/apt-get-prefetch.sh b/.github/scripts/apt-get-prefetch.sh index 2994f3bd6..455e84564 100755 --- a/.github/scripts/apt-get-prefetch.sh +++ b/.github/scripts/apt-get-prefetch.sh @@ -46,6 +46,7 @@ if [ "${1:-}" = install ]; then if curl -fsL --connect-timeout 10 --speed-limit 51200 --speed-time 15 \ --max-time 300 -o "$tmp" "$candidate" && echo "$sum $tmp" | "$checker" --status -c; then + chmod 644 "$tmp" mv "$tmp" "$archives/$file" return 0 fi diff --git a/.github/scripts/install-playwright.sh b/.github/scripts/install-playwright.sh index 3b2a04c67..4e2dd5655 100755 --- a/.github/scripts/install-playwright.sh +++ b/.github/scripts/install-playwright.sh @@ -93,7 +93,8 @@ if [ -n "$apt_cache" ]; then mkdir -p "$apt_cache" find "$apt_cache" -name '*.deb' -delete if compgen -G "$archives/*.deb" > /dev/null; then - cp "$archives"/*.deb "$apt_cache/" + sudo cp "$archives"/*.deb "$apt_cache/" + sudo chown "$(id -u):$(id -g)" "$apt_cache"/*.deb fi echo "Kept $(find "$apt_cache" -name '*.deb' | wc -l) package(s) for the apt cache" fi