1010 SED ?= sed
1111endif
1212
13-
14- ifeq ($(LYCHEE_GITHUB_TOKEN ) ,)
15- LYCHEE_GITHUB_TOKEN_ARG :=
16- else
17- LYCHEE_GITHUB_TOKEN_ARG := --env GITHUB_TOKEN=$(LYCHEE_GITHUB_TOKEN )
18- endif
19-
2013TOOLS_DIR := $(PWD ) /internal/tools
2114
22- MARKDOWN_LINK_CHECK_ARG = # pass extra arguments such as --exclude '^http'
2315MISSPELL_BINARY =bin/misspell
2416MISSPELL = $(TOOLS_DIR ) /$(MISSPELL_BINARY )
2517
@@ -33,14 +25,12 @@ CONTAINER_REPOSITORY=docker.io
3325# Per container overrides for the repository resolution.
3426WEAVER_CONTAINER_REPOSITORY =$(CONTAINER_REPOSITORY )
3527OPA_CONTAINER_REPOSITORY =$(CONTAINER_REPOSITORY )
36- LYCHEE_CONTAINER_REPOSITORY =$(CONTAINER_REPOSITORY )
3728
3829# Versioned, non-qualified references to containers used in this Makefile.
3930# These are parsed from dependencies.Dockerfile so dependabot will autoupdate
4031# the versions of docker files we use.
4132VERSIONED_WEAVER_CONTAINER_NO_REPO =$(shell cat dependencies.Dockerfile | awk '$$4=="weaver" {print $$2}')
4233VERSIONED_OPA_CONTAINER_NO_REPO =$(shell cat dependencies.Dockerfile | awk '$$4=="opa" {print $$2}')
43- VERSIONED_LYCHEE_CONTAINER_NO_REPO =$(shell cat dependencies.Dockerfile | awk '$$4=="lychee" {print $$2}')
4434
4535# Fully qualified references to containers used in this Makefile. These
4636# include the container repository, so that the build will work with tools
@@ -52,7 +42,6 @@ VERSIONED_LYCHEE_CONTAINER_NO_REPO=$(shell cat dependencies.Dockerfile | awk '$$
5242# and no unqualified-search registries are defined in "/etc/containers/registries.conf"
5343WEAVER_CONTAINER =$(WEAVER_CONTAINER_REPOSITORY ) /$(VERSIONED_WEAVER_CONTAINER_NO_REPO )
5444OPA_CONTAINER =$(OPA_CONTAINER_REPOSITORY ) /$(VERSIONED_OPA_CONTAINER_NO_REPO )
55- LYCHEE_CONTAINER =$(LYCHEE_CONTAINER_REPOSITORY ) /$(VERSIONED_LYCHEE_CONTAINER_NO_REPO )
5645
5746# Determine if "docker" is actually podman
5847DOCKER_VERSION_OUTPUT := $(shell docker --version 2>&1)
@@ -121,27 +110,11 @@ normalized-link-check:
121110
122111.PHONY : markdown-link-check
123112markdown-link-check : normalized-link-check
124- $(DOCKER_RUN ) --rm \
125- $(DOCKER_USER_IS_HOST_USER_ARG ) \
126- --mount ' type=bind,source=$(PWD),target=/home/repo' $(LYCHEE_GITHUB_TOKEN_ARG ) \
127- $(LYCHEE_CONTAINER ) \
128- --config home/repo/.lychee.toml \
129- --root-dir /home/repo \
130- --verbose \
131- --timeout=60 \
132- $(MARKDOWN_LINK_CHECK_ARG ) \
133- home/repo
134-
135- .PHONY : markdown-link-check-changelog-preview
136- markdown-link-check-changelog-preview :
137- $(DOCKER_RUN ) --rm \
138- $(DOCKER_USER_IS_HOST_USER_ARG ) \
139- --mount ' type=bind,source=$(PWD),target=/home/repo' $(LYCHEE_GITHUB_TOKEN_ARG ) \
140- $(LYCHEE_CONTAINER ) \
141- --config /home/repo/.lychee.toml \
142- --root-dir /home/repo \
143- --verbose \
144- home/repo/changelog_preview.md
113+ .github/scripts/link-check.sh $(FILES )
114+
115+ .PHONY : markdown-link-check-local-only
116+ markdown-link-check-local-only : normalized-link-check
117+ .github/scripts/link-check.sh --local-links-only $(FILES )
145118
146119# This target runs markdown-toc on all files that contain
147120# a comment <!-- tocstop -->.
0 commit comments