Skip to content

Commit eaa262d

Browse files
authored
Upgrade muffet (#28)
1 parent 4a5dcd1 commit eaa262d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LABEL "com.github.actions.description"="Check broken links on web pages stored l
99
LABEL "com.github.actions.icon"="list"
1010
LABEL "com.github.actions.color"="blue"
1111

12-
ENV MUFFET_VERSION="2.2.1"
12+
ENV MUFFET_VERSION="2.3.0"
1313
#ENV MUFFET_VERSION="latest"
1414

1515
ENV CADDY_VERSION="2.2.1"

entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -Eeuo pipefail
44

5-
export MUFFET_VERSION="2.2.1"
5+
export MUFFET_VERSION="2.3.0"
66
export CADDY_VERSION="2.2.1"
77

88
# Command line parameters for muffet
@@ -44,7 +44,7 @@ print_info() {
4444
cleanup() {
4545
if [ -n "${PAGES_PATH}" ]; then
4646
# Manipulation with /etc/hosts using 'sed -i' doesn't work inside containers
47-
if ! grep -q -E '(docker|containerd)' /proc/self/cgroup ; then
47+
if ! grep -E '(docker|containerd)' /proc/self/cgroup &> /dev/null ; then
4848
$sudo_cmd sed -i "/127.0.0.1 ${PAGES_DOMAIN} # Created by my-broken-link-checker/d" /etc/hosts
4949
fi
5050
$sudo_cmd caddy stop &> /dev/null
@@ -82,10 +82,11 @@ fi
8282
# Install caddy if needed
8383
if ! hash caddy &> /dev/null && [ -n "${PAGES_PATH}" ] ; then
8484

85+
PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
8586
if [ "${CADDY_VERSION}" = "latest" ]; then
86-
CADDY_URL=$(wget --quiet https://api.github.com/repos/caddyserver/caddy/releases/latest -O - | grep "browser_download_url.*caddy_.*_linux_amd64.tar.gz" | cut -d \" -f 4)
87+
CADDY_URL=$(wget --quiet https://api.github.com/repos/caddyserver/caddy/releases/latest -O - | grep "browser_download_url.*caddy_.*_${PLATFORM}_amd64.tar.gz" | cut -d \" -f 4)
8788
else
88-
CADDY_URL="https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_amd64.tar.gz"
89+
CADDY_URL="https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_${PLATFORM}_amd64.tar.gz"
8990
fi
9091

9192
wget --quiet "${CADDY_URL}" -O - | $sudo_cmd tar xzf - -C /usr/local/bin/ caddy

0 commit comments

Comments
 (0)