Skip to content

Commit

Permalink
CI: warn about external links to local pages rather than abort with a…
Browse files Browse the repository at this point in the history
…n error (#2497)
  • Loading branch information
chalin authored Mar 13, 2023
1 parent 6a4b374 commit e94c9d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand Down

0 comments on commit e94c9d6

Please sign in to comment.