diff options
-rw-r--r-- | .gitlab-ci.yml | 23 | ||||
-rwxr-xr-x | tasks/unlinked-images.sh | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 326f7861..d7591b0d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -293,6 +293,29 @@ test_EOL_whitespace: - markdownlint --version - markdownlint -c .markdownlint.json **/*.md +test_unlinked_images: + extends: + - .rules_chores + stage: test + image: registry.gitlab.com/gitlab-org/gitlab-docs/lint:latest + needs: [] + before_script: [] + dependencies: [] + script: + - bundle exec rake setup_git default + - cp tasks/unlinked-images.sh tmp/ee/unlinked-images.sh + - cp tasks/unlinked-images.sh tmp/charts/unlinked-images.sh + - cp tasks/unlinked-images.sh tmp/omnibus/unlinked-images.sh + - cp tasks/unlinked-images.sh tmp/runner/unlinked-images.sh + - cd tmp/omnibus + - ./unlinked-images.sh doc + - cd ../charts + - ./unlinked-images.sh doc + - cd ../runner + - ./unlinked-images.sh docs + - cd ../ee + - ./unlinked-images.sh doc + ############################################### # Review Apps # ############################################### diff --git a/tasks/unlinked-images.sh b/tasks/unlinked-images.sh new file mode 100755 index 00000000..91e5710f --- /dev/null +++ b/tasks/unlinked-images.sh @@ -0,0 +1,3 @@ +for FILE in $(git ls-files ./$1/*.png ./$1/*.gif ./$1/*.jpg); do + git grep $(basename "$FILE") > /dev/null || echo "Unlinked file: $FILE" +done |