Skip to content

Docs - Python: Script to detect sensitive files with configuration file #1119

@palisadoes

Description

@palisadoes

Is your feature request related to a problem? Please describe.

  1. The .github/workflows/pull-request.yml has a job named Check-Sensitive-Files that detects when a PR has modified files that require additional attention for reviewers.

  2. The job has the list of these files inside the YAML file

  3. This means the YAML instructions (code) and the configuration are not separated. This is not a best practice.

Describe the solution you'd like

  1. A python script located in the .github/workflows/scripts that uses a simple text file of regular expressions to evaluate.

  2. The text file must be located in the .github/workflows/config directory

  3. The python script must use the argparse library to allow the specification of the configuration file.

  4. The python file must also be able to check multiple files and/or directories for the files. There are other python scripts in the .github/workflows/scripts that do the same. You can use them for guidance.1. The new script must be added to this file as a prerequisite to the Pre-Test-Checks-Pass job:

    .github/workflows/pull-request.yml
    
  5. The script must be compatible with these python linters. Please research how to evaluate this before submitting the PR. It will save you a lot of time:

    1. python black
    2. pylint
    3. flake8
    4. Python docstring_parser
    5. pydocstyle
  6. The functionality of the python script must match that of the existing sensitive file check, and must replace one or more relevant lines in the Check-Sensitive-Files job.

    • Refer to the Check-ItSkip-Disable job to see how you can trim the amount of lines in the GitHub action YAML

Describe alternatives you've considered

  • N/A

Approach to be followed (optional)

  • N/A

Additional context

  1. Similar Pull Requests

  2. Similar Issues

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions