Skip to content

Commit

Permalink
renovate: Work around bug in atomically package (#41261)
Browse files Browse the repository at this point in the history
When #40842 updated `configstore`, that brought in `atomically` v2.0.3
which has a bug where it crashes if the current user is not listed in
`/etc/passwd`, which happens inside our docker container during the
renovate run.

Work around this by making sure an appropriate entry is added to
`/etc/passwd` inside the container.
  • Loading branch information
anomiex authored Jan 28, 2025
1 parent 67353e6 commit 827502b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/files/renovate-post-upgrade-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ if [[ ! -e /tmp/dummy-log/xdebug_remote.log ]]; then
fi

docker pull --quiet ghcr.io/automattic/jetpack-wordpress-dev:latest
docker run --rm --workdir "$PWD" --user $EUID --volume /tmp/:/tmp/ --volume /tmp/dummy-log:/var/log/php ghcr.io/automattic/jetpack-wordpress-dev:latest /tmp/monorepo/.github/files/renovate-post-upgrade.sh "$@"

# Work around https://github.com/fabiospampinato/atomically/issues/13 by extracting /etc/passwd from the container and appending the entry for $EUID to it.
TMPFILE=$( mktemp )
function cleanup {
rm -f "$TMPFILE"
}
trap cleanup exit
chmod 0644 "$TMPFILE"
docker run --rm ghcr.io/automattic/jetpack-wordpress-dev:latest cat /etc/passwd > "$TMPFILE"
getent passwd $EUID >> "$TMPFILE"

docker run --rm --workdir "$PWD" --user $EUID --volume "$TMPFILE":/etc/passwd --volume /tmp/:/tmp/ --volume /tmp/dummy-log:/var/log/php ghcr.io/automattic/jetpack-wordpress-dev:latest /tmp/monorepo/.github/files/renovate-post-upgrade.sh "$@"

0 comments on commit 827502b

Please sign in to comment.