Skip to content

Commit ca6d2b4

Browse files
committed
Reproducible npm build
1 parent 9ed1a59 commit ca6d2b4

File tree

7 files changed

+623
-3
lines changed

7 files changed

+623
-3
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ updates:
1111
directory: /
1212
schedule:
1313
interval: daily
14+
15+
- package-ecosystem: npm
16+
directory: /
17+
schedule:
18+
interval: daily

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.envrc
2+
node_modules/

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ repos:
2121
- id: pretty-format-json
2222
args:
2323
- --autofix
24+
exclude: package-lock.json
2425
- id: trailing-whitespace
2526
exclude: examples/ignore/example-ignore.md
2627

@@ -37,4 +38,12 @@ repos:
3738
hooks:
3839
- id: actionlint-docker
3940

41+
- repo: local
42+
hooks:
43+
- id: package-lock
44+
name: package.json and package-lock.json are in step
45+
entry: npm ci --omit=dev --silent
46+
language: system
47+
pass_filenames: false
48+
4049
minimum_pre_commit_version: !!str 4.2

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FROM node:lts-alpine@sha256:41e4389f3d988d2ed55392df4db1420ad048ae53324a8e2b7c6d19508288107e
22

3-
RUN npm install --global --omit=dev --update-notifier=false markdownlint-cli@0.43.0
3+
COPY package.json package-lock.json /
4+
RUN npm ci --omit=dev
45

5-
COPY entrypoint.sh /entrypoint.sh
66
COPY markdownlint-problem-matcher.json /markdownlint-problem-matcher.json
7+
8+
COPY entrypoint.sh /entrypoint.sh
79
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cp /markdownlint-problem-matcher.json "${PROBLEM_MATCHER:?}" || exit
1313
echo "::add-matcher::${PROBLEM_MATCHER:?}"
1414

1515
# shellcheck disable=SC2086
16-
${MARKDOWNLINT} ${INPUT_FILES:?}
16+
npx ${MARKDOWNLINT} ${INPUT_FILES:?}
1717
readonly RC=$?
1818

1919
echo '::remove-matcher owner=markdownlint::'

0 commit comments

Comments
 (0)