CI: warn about external links to local pages rather than abort with an error (#2497)

This commit is contained in:
Patrice Chalin 2023-03-13 14:48:03 -04:00 committed by GitHub
parent 6a4b374c2e
commit e94c9d6fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,10 +1,10 @@
{{ $isExternal := hasPrefix .Destination "http" -}}
{{ if $isExternal -}}
{{ if findRE "^https://opentelemetry.io/\\w" .Destination -}}
{{ errorf "%s: use a local path, not an external URL, for the following reference to a site local page: %s"
{{ warnf "%s: use a local path, not an external URL, for the following reference to a site local page: %s"
.Page.File.Path .Destination -}}
{{ else if findRE "^https://github.com/open-telemetry/opentelemetry-specification/(blob|tree)/main/specification/\\w" .Destination -}}
{{ errorf "%s: use a local path, not an external URL, for the following reference to a local specification page: %s"
{{ warnf "%s: use a local path, not an external URL, for the following reference to a local specification page: %s"
.Page.File.Path .Destination -}}
{{ end -}}
{{ end -}}