File tree 2 files changed +33
-3
lines changed
2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1
- FROM alpine:3.16.0
1
+ FROM alpine:3.18.4
2
2
LABEL "name" ="sh-checker"
3
3
LABEL "maintainer" ="Luiz Muller <contact@luizm.dev>"
4
4
5
- ARG shfmt_version=3.6 .0
5
+ ARG shfmt_version=3.7 .0
6
6
ARG shellcheck_version=0.9.0
7
- ARG gh_version=2.23 .0
7
+ ARG gh_version=2.37 .0
8
8
9
9
RUN apk add --no-cache bash git jq curl checkbashisms xz \
10
10
&& apk add --no-cache --virtual .build-deps tar \
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # shellcheck disable=SC2312 # (info): Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
3
+
4
+ set -e
5
+
6
+ if command -v curl > /dev/null; then
7
+ # -sq == --silent --disable
8
+ dl=" curl -sq"
9
+ else
10
+ # -q0 == --quiet --output-document
11
+ dl=' wget --no-config -qO -'
12
+ fi
13
+
14
+ ALPINE_VER=$( ${dl} ' https://registry.hub.docker.com/v2/repositories/library/alpine/tags/' | jq -r ' .results[1].name' )
15
+ GH_VER=$( ${dl} https://api.github.com/repos/cli/cli/tags | jq -r ' .[0].name' )
16
+ SHELLCHECK_VER=$( ${dl} https://api.github.com/repos/koalaman/shellcheck/tags | jq -r ' .[0].name' )
17
+ SHFMT_VER=$( ${dl} https://api.github.com/repos/mvdan/sh/tags | jq -r ' .[0].name' )
18
+
19
+ GH_VER=" ${GH_VER/ v/ } "
20
+ SHELLCHECK_VER=" ${SHELLCHECK_VER/ v/ } "
21
+ SHFMT_VER=" ${SHFMT_VER/ v/ } "
22
+
23
+ sed -Ei "
24
+ s/^(FROM\s+alpine:).*/\1${ALPINE_VER} /;
25
+ s/^(ARG\s+gh_version=).*/\1${GH_VER} /;
26
+ s/^(ARG\s+shellcheck_version=).*/\1${SHELLCHECK_VER} /;
27
+ s/^(ARG\s+shfmt_version=).*/\1${SHFMT_VER} /;
28
+ " Dockerfile
29
+
30
+ git diff
You can’t perform that action at this time.
0 commit comments