mirror of
https://github.com/public-apis/public-apis.git
synced 2025-06-04 03:41:48 +02:00
check for no links in link file and fail if not pull request
This commit is contained in:
parent
ab5d27c575
commit
90e4670ce4
2 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,9 @@ if [ "$TRAVIS_BRANCH" == "master" ]; then
|
||||||
echo "link validation failed!"
|
echo "link validation failed!"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||||
|
echo "no links to check on $TRAVIS_BRANCH branch - script failure!"
|
||||||
|
fi
|
||||||
echo "link validation passed!"
|
echo "link validation passed!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,6 +17,10 @@ raw_links.each do |link|
|
||||||
links.push(link)
|
links.push(link)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if links.length <= 0
|
||||||
|
puts "no links to check"
|
||||||
|
exit(0)
|
||||||
|
end
|
||||||
fails = []
|
fails = []
|
||||||
# Fail on any duplicate elements
|
# Fail on any duplicate elements
|
||||||
dup = links.select{|element| links.count(element) > 1}
|
dup = links.select{|element| links.count(element) > 1}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue