mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 07:16:42 +00:00
try to support a single ignore expression
This commit is contained in:
9
main.py
9
main.py
@@ -348,6 +348,8 @@ class TodoParser(object):
|
||||
if not filename_search:
|
||||
continue
|
||||
curr_file = filename_search.group(0)
|
||||
if self._should_ignore(curr_file):
|
||||
continue
|
||||
curr_markers, curr_markdown_language = self._get_file_details(curr_file)
|
||||
if not curr_markers or not curr_markdown_language:
|
||||
print(f'Could not check {curr_file} for TODOs as this language is not yet supported by default.')
|
||||
@@ -604,6 +606,13 @@ class TodoParser(object):
|
||||
projects = list(filter(None, projects.split(',')))
|
||||
return projects
|
||||
|
||||
def _should_ignore(self, file):
|
||||
ignore_pattern = os.getenv('INPUT_IGNORE', None)
|
||||
if ignore_pattern:
|
||||
if re.match(ignore_pattern, file):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Create a basic client for communicating with GitHub, automatically initialised with environment variables.
|
||||
|
||||
Reference in New Issue
Block a user