Skip to content

Fix release link validations. #4970

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

Merged
Merged
Changes from all commits
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
7 changes: 5 additions & 2 deletions utils/validate_release_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ def check_file(
new_file_name = os.path.join(tempdir, os.path.basename(filename))
with open(new_file_name, "w+") as new_file:
# default to match everything if there is nothing in the ALLOW_LIST
allow_list_pattern = ALLOW_LIST.get(filename, MATCH_ANY)
allow_list_pattern = ALLOW_LIST.get(filename, None)
with open(filename) as f:
for line in f:
keep_line = True
keep_line = not RELEASE_PATTERN.search(line)
keep_line |= global_allow_pattern.search(line) is not None
keep_line |= allow_list_pattern.search(line) is not None
keep_line |= (
allow_list_pattern is not None
and allow_list_pattern.search(line) is not None
)

if keep_line:
new_file.write(line)
Expand Down