{"id":21894763,"url":"https://github.com/zumba/regex-match-commenter-action","last_synced_at":"2025-03-22T04:21:22.275Z","repository":{"id":221930635,"uuid":"755800114","full_name":"zumba/regex-match-commenter-action","owner":"zumba","description":"Regex Match GitHub Action","archived":false,"fork":false,"pushed_at":"2025-03-11T19:01:32.000Z","size":1139,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-11T20:19:42.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zumba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-11T05:02:54.000Z","updated_at":"2025-03-11T19:01:34.000Z","dependencies_parsed_at":"2024-02-21T00:53:35.570Z","dependency_job_id":"403ceedb-a9f5-4009-bd68-cfff2ec554e6","html_url":"https://github.com/zumba/regex-match-commenter-action","commit_stats":null,"previous_names":["zumba/regex-match-commenter-action"],"tags_count":2,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fregex-match-commenter-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fregex-match-commenter-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fregex-match-commenter-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fregex-match-commenter-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zumba","download_url":"https://codeload.github.com/zumba/regex-match-commenter-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244904314,"owners_count":20529410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T13:28:01.890Z","updated_at":"2025-03-22T04:21:22.254Z","avatar_url":"https://github.com/zumba.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Regular Expression Match Commenter Action\n\n[![GitHub Super-Linter](https://github.com/zumba/regex-match-commenter-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)\n![CI](https://github.com/zumba/regex-match-commenter-action/actions/workflows/ci.yml/badge.svg)\n[![Check dist/](https://github.com/zumba/regex-match-commenter-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/zumba/regex-match-commenter-action/actions/workflows/check-dist.yml)\n[![CodeQL](https://github.com/zumba/regex-match-commenter-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/zumba/regex-match-commenter-action/actions/workflows/codeql-analysis.yml)\n[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)\n\nThis GitHub Action searches for specified regular expression pattern in the\nchanges of a pull request. If matches are found, it can optionally mark the\npull request for changes and add inline comments. If no matches are found,\na comment is added to the pull request.\n\nSome use cases are for detecting PII changes on the code. For example, you can\nmonitor if the words `email`, `phone`, `street`, `password`, etc. are part of\nthe changes.\nThe match uses regular expression, so you can also look for variables such as\n`\\w+@\\w+.\\w+` to look for an actual email address.\n\n## Inputs\n\n### `github_token`\n\n**Required** GitHub token for authentication. Typically, this is the GitHub\nActions token.\n\n### `regex_pattern`\n\n**Required** A regular expression pattern to search for in the pull\nrequest diff.\n\n### `diff_scope`\n\nThe scope of the diff to search. Can be `added`, `removed`, or `both`.\nDefault is `both`.\n\n### `mark_changes_requested`\n\nBoolean indicating whether the pull request should be marked as \"request\nchanges\" if regular expression matches are found. Default is `false`.\n\n### `match_found_message`\n\nCustom message for a regular expression match. This message is used for inline\ncomments on the pull request. Default is `Regex match found.`.\n\n### `no_match_found_message`\n\nCustom message to comment on the pull request when no regular expression\nmatches are found. Default is `No regex matches found in the diff.`\n\n### `changes_requested_message`\n\nCustom message for marking the pull request as changes requested. Used only if\n`mark_changes_requested` is `true`. Default is\n`Changes are requested due to regex match.`\n\n## Usage\n\nTo use this action, create a workflow file (e.g.,\n`.github/workflows/regex-match.yml`) in your repository:\n\n```yaml\nname: Regex Match\n\non: [pull_request]\n\njobs:\n  regex-match:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - name: Regex Match Action\n      uses: zumba/regex-match-commenter-action@v1\n      with:\n        github_token: ${{ secrets.GITHUB_TOKEN }}\n        regex_pattern: 'email|phone'\n        diff_scope: 'both'\n        mark_changes_requested: false\n        match_found_message: 'Attention needed.'\n        no_match_found_message: 'No issues detected in the diff.'\n        changes_requested_message: 'Please address the commented issues.'\n```\n\n## Contributing\n\nContributions to this action are welcome! Please follow the standard GitHub\npull request workflow to submit your changes.\n\n## Development Setup\n\nAfter you've cloned the repository to your local machine or codespace, you'll\nneed to perform some initial setup steps before you can develop your action.\n\n1. :hammer_and_wrench: Install the dependencies\n\n   ```bash\n   npm install\n   ```\n\n1. :building_construction: Package the TypeScript for distribution\n\n   ```bash\n   npm run bundle\n   ```\n\n1. :white_check_mark: Run the tests\n\n   ```bash\n   $ npm test\n\n   PASS  ./index.test.js\n   ```\n\n## Publishing a New Release\n\nThis project includes a helper script, [`script/release`](./script/release)\ndesigned to streamline the process of tagging and pushing new releases for\nGitHub Actions.\n\nGitHub Actions allows users to select a specific version of the action to use,\nbased on release tags. This script simplifies this process by performing the\nfollowing steps:\n\n1. **Retrieving the latest release tag:** The script starts by fetching the most\n   recent release tag by looking at the local data available in your repository.\n1. **Prompting for a new release tag:** The user is then prompted to enter a new\n   release tag. To assist with this, the script displays the latest release tag\n   and provides a regular expression to validate the format of the new tag.\n1. **Tagging the new release:** Once a valid new tag is entered, the script tags\n   the new release.\n1. **Pushing the new tag to the remote:** Finally, the script pushes the new tag\n   to the remote repository. From here, you will need to create a new release in\n   GitHub and users can easily reference the new tag in their workflows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzumba%2Fregex-match-commenter-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzumba%2Fregex-match-commenter-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzumba%2Fregex-match-commenter-action/lists"}