Closed timmorey closed 3 years ago
Thanks for the suggestion, I think it's a good idea.
I think something along the lines of what you suggested would work well. Around here we could check the filename against the provided patterns and continue
if there is a match:
Here's some pseudocode, assuming the patterns are provided as a comma-separated list of regex patterns (not ideal, but not sure if a list can be provided to the action?):
- name: "TODO to Issue"
uses: "alstr/todo-to-issue-action@v4.0.2"
id: "todo"
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLOSE_ISSUES: true
IGNORE: "foo/bar/file.txt, images/.*"
ignore_patterns = os.getenv('INPUT_IGNORE', None)
if ignore_patterns:
skip_file = False
patterns_list = ignore_patterns.replace(', ', ',')
patterns_list = list(filter(None, patterns_list.split(',')))
for pattern in patterns_list:
pattern_search = re.search(pattern, curr_file)
if pattern_search.group(0):
skip_file = True
break
if skip_file:
continue
I haven't tested any of that.
We have some code in one of our repositories that we don't really own, and we'd like to avoid creating TODO issues when it is updated.
The use case is that we have some code committed in our
vendor
directory that is developed by another team. We need it at build time (and can't justnpm install
it), and we periodically update it to make sure we've got the latest version. When we update it, this action creates issues for TODO comments in the code, even though we aren't in a position to address those TODOs.Do you think it would be possible to add an optional patterns, indicating which files should be ignored (or which ones should be parsed)? For example, we'd like to be able to configure something like
If this sounds feasible and desirable, I would be interested in taking a stab at implementation (some guidance would be helpful).