File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ if [ -z " $VERBOSE " ]; then VERBOSE=0; fi
4+ if [ " $VERBOSE " -gt 1 ]; then set -x; fi
5+ set -e
6+ set -o pipefail
7+
38# This script is referenced by .github/workflows/test.yml which executes on
49# each pull request.
510
@@ -16,11 +21,20 @@ SKIP_PATTERNS=(
1621 ' http://localhost' # local host
1722)
1823
19- if [ " _${VERBOSE} _" == " __" ]; then VERBOSE=0; fi
24+ BRANCH=$( git rev-parse --abbrev-ref HEAD)
25+ REMOTE=$( git config branch.$BRANCH .remote || echo " origin" )
26+ git fetch --depth=1 $REMOTE main
27+ GIT_DIFF_OUTPUT=$( git diff $REMOTE /main)
28+
29+ # the greps are allowed to "fail" without matching
30+ URLS=$( echo " $GIT_DIFF_OUTPUT " \
31+ | grep ' ^+' \
32+ | grep --extended-regexp --only-matching \
33+ ' (http|https)://[^ )"><]+' \
34+ || true
35+ )
2036
21- for URL in $( git diff develop |
22- grep ' ^+' |
23- grep -Eo ' (http|https)://[^ )"><]+' ) ; do
37+ for URL in $URLS ; do
2438 SKIP_URL=0
2539 for PATTERN in " ${SKIP_PATTERNS[@]} " ; do
2640 if echo " $URL " | grep --quiet --extended-regexp " $PATTERN "
You can’t perform that action at this time.
0 commit comments