Skip to content

Commit

Permalink
fix url validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 committed Mar 26, 2024
1 parent 8e95225 commit e967848
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/check_scripts/check_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def validate_category(d,f):

def check_bibtex_file(d, f):
p = pathlib.Path(f).parent.parent / 'publication'
print(p)
if 'bibtex' in d and d['bibtex']:
return (p / d['bibtex']).exists()
return True
Expand All @@ -31,12 +30,17 @@ def validate_orcid(d, f):

def validate_url(d, f):
regex = re.compile(r'^https?://')
try:
if re.search(regex, d['homepage']):
return False
except Exception:
if 'homepage' in d.keys():
if d['homepage'] is not None:
if re.search(regex, d['homepage']):
return True
else: # case value do not follow specification
return False
else: # case no value provided for homepage tag
return True
else: # case no homepage tag
return True
return True




Expand Down

0 comments on commit e967848

Please sign in to comment.