Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent absolute links from adoc to www.jenkins.io and jenkins.io #5899

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Never fail new check on trusted
  • Loading branch information
MarkEWaite committed Jan 10, 2023
commit 185fbf8c3e30189cba9d84059adc3689ffe04556
26 changes: 15 additions & 11 deletions scripts/check-hard-coded-URL-references
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# See https://github.com/jenkins-infra/jenkins.io/issues/5718
# See also https://github.com/jenkins-infra/jenkins.io/pull/5715

# Returns 0 if no issues are detected
# Returns 0 if no issues are detected or script is running on trusted.ci.jenkins.io
# Returns 1 if one or more adoc files include https://www.jenkins.io
# Returns 2 if one or more adoc files include https://jenkins.io
# Returns 3 if both https://www.jenkins.io and https://jenkins.io are found
Expand All @@ -19,21 +19,25 @@ return_code=0
files=$(git grep -l https://www.jenkins.io -- content/[a-zA-Z]**/*.adoc)
if [ "$files" != "" ]; then
echo "ERROR: incorrectly used https://www.jenkins.io in ${files}"
echo
echo "See https://github.com/jenkins-infra/jenkins.io/issues/5718"
echo "See also https://github.com/jenkins-infra/jenkins.io/pull/5715"
echo
return_code=1
echo
echo "See https://github.com/jenkins-infra/jenkins.io/issues/5718"
echo "See also https://github.com/jenkins-infra/jenkins.io/pull/5715"
echo
return_code=1
fi

files=$(git grep -l https://jenkins.io -- content/[a-zA-Z]**/*.adoc)
if [ "$files" != "" ]; then
echo "ERROR: incorrectly used https://jenkins.io in ${files}"
echo
echo "See https://github.com/jenkins-infra/jenkins.io/issues/5718"
echo "See also https://github.com/jenkins-infra/jenkins.io/pull/5715"
echo
return_code=$(( return_code + 2 ))
echo
echo "See https://github.com/jenkins-infra/jenkins.io/issues/5718"
echo "See also https://github.com/jenkins-infra/jenkins.io/pull/5715"
echo
return_code=$(( return_code + 2 ))
fi

if [[ "${BUILD_URL}" =~ "trusted.ci.jenkins.io" ]]; then
exit 0
fi

exit $return_code