File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
scripts/validate-contributor-readmes Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -414,7 +414,7 @@ func parseContributorFiles(readmeEntries []readme) (
414414 contributorProfileFrontmatter : yml ,
415415 }
416416
417- if prev , conflict := frontmatterByUsername [processed .GithubUsername ]; conflict {
417+ if prev , isConflict := frontmatterByUsername [processed .GithubUsername ]; isConflict {
418418 yamlParsingErrors .Errors = append (
419419 yamlParsingErrors .Errors ,
420420 fmt .Errorf (
@@ -534,6 +534,17 @@ func validateRelativeUrls(
534534 continue
535535 }
536536
537+ if strings .HasPrefix (* con .AvatarUrl , ".." ) {
538+ problems = append (
539+ problems ,
540+ fmt .Errorf (
541+ "%q: relative avatar URLs cannot be placed outside a user's namespaced directory" ,
542+ con .FilePath ,
543+ ),
544+ )
545+ continue
546+ }
547+
537548 absolutePath := strings .TrimSuffix (con .FilePath , "README.md" ) +
538549 * con .AvatarUrl
539550 _ , err := os .ReadFile (absolutePath )
You can’t perform that action at this time.
0 commit comments