From 2c151151511a08cc2a76bcb79b74636f7ed51f4d Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 18 Apr 2019 12:49:32 -0400 Subject: [PATCH] fixup! build: add Travis job to check for dead URL links --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7abc39c16c4a6..802950a39ec79c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,7 @@ jobs: - NODE=$(which node) make lint lint-py - name: "Docs" + if: type = pull_request language: node_js node_js: "node" install: @@ -85,7 +86,12 @@ jobs: - make doc-only - npm install -g linkinator script: - - linkinator out/doc/api -r + - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then + DOC_FILES=`curl -sL https://github.com/nodejs/node/pull/${TRAVIS_PULL_REQUEST}.patch | grep -o '\bdoc/api/.*\.md\b'` + if [ -n "${DOC_FILES}" ]; then + linkinator out/doc/api -r; + fi + fi - name: "First commit message adheres to guidelines at https://goo.gl/p2fr5Q" if: type = pull_request