File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1919 - run : bundle install
2020 - run : ./script/test-markdown.sh
2121 - run : ./script/test-without-link-check.sh
22- - run : ./script/check-new-links.sh
22+ - run : VERBOSE=1 ./script/check-new-links.sh
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ set -e
3+ set -o pipefail
24
35# This script is referenced by .github/workflows/test.yml which executes on
46# each pull request.
@@ -18,9 +20,18 @@ SKIP_PATTERNS=(
1820
1921if [ " _${VERBOSE} _" == " __" ]; then VERBOSE=0; fi
2022
21- for URL in $( git diff develop |
23+ BRANCH=$( git rev-parse --abbrev-ref HEAD)
24+ REMOTE=$( git config branch.$BRANCH .remote)
25+ git fetch --depth=1 $REMOTE main
26+
27+ # the second grep is allowed to "fail" without matching
28+ URLS=$( git diff main |
2229 grep ' ^+' |
23- grep -Eo ' (http|https)://[^ )"><]+' ) ; do
30+ grep --extended-regexp --only-matching \
31+ ' (http|https)://[^ )"><]+' || true
32+ )
33+
34+ for URL in $URLS ; do
2435 SKIP_URL=0
2536 for PATTERN in " ${SKIP_PATTERNS[@]} " ; do
2637 if echo " $URL " | grep --quiet --extended-regexp " $PATTERN "
You can’t perform that action at this time.
0 commit comments