{"id":22120967,"url":"https://github.com/actions-ecosystem/action-regex-match","last_synced_at":"2025-04-07T07:16:44.312Z","repository":{"id":36955347,"uuid":"261130368","full_name":"actions-ecosystem/action-regex-match","owner":"actions-ecosystem","description":"🔍 GitHub Action to do regex matching","archived":false,"fork":false,"pushed_at":"2024-03-20T19:38:31.000Z","size":415,"stargazers_count":108,"open_issues_count":34,"forks_count":36,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T06:03:13.545Z","etag":null,"topics":["actions","github","regex"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/actions-ecosystem-action-regex-match","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/actions-ecosystem.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-04T09:23:19.000Z","updated_at":"2025-02-28T15:24:53.000Z","dependencies_parsed_at":"2024-09-26T20:09:59.782Z","dependency_job_id":"73944bd8-76b0-4909-a2ce-6fc83e5c862e","html_url":"https://github.com/actions-ecosystem/action-regex-match","commit_stats":{"total_commits":24,"total_committers":5,"mean_commits":4.8,"dds":0.375,"last_synced_commit":"d50fd2e7a37d0e617aea3d7ada663bd56862b9cc"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-regex-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-regex-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-regex-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-regex-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actions-ecosystem","download_url":"https://codeload.github.com/actions-ecosystem/action-regex-match/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608154,"owners_count":20965952,"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":["actions","github","regex"],"created_at":"2024-12-01T14:31:50.827Z","updated_at":"2025-04-07T07:16:44.292Z","avatar_url":"https://github.com/actions-ecosystem.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Action Regex Match\n\n[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test]\n[![release][release-badge]][release]\n[![license][license-badge]][license]\n\nThis is a GitHub Action to do regex matching and output the matched text and groups captured by the given regex.\n\nGitHub Actions natively supports some helpful functions, like `contains` and `startsWith`, but doesn't regex matching.\nThis actions provides the missing, useful function.\n\nIt would be more useful to use this with other GitHub Actions' outputs.\n\n## Inputs\n\n|  NAME   |                      DESCRIPTION                      |   TYPE   | REQUIRED | DEFAULT |\n| ------- | ----------------------------------------------------- | -------- | -------- | ------- |\n| `text`  | A text as the target for `inputs.regex`.              | `string` | `true`   | `N/A`   |\n| `regex` | A regex for `inputs.text`. Supports capturing groups. | `string` | `true`   | `N/A`   |\n| `flags` | Flags for inputs.regex. e.g.) `'g'`, `'gm'`           | `string` | `false`  | `''`    |\n\n## Outputs\n\n|   NAME   |                                          DESCRIPTION                                           |   TYPE   |\n| -------- | ---------------------------------------------------------------------------------------------- | -------- |\n| `match`  | The whole matched text. If the `inputs.regex` doesn't match `inputs.text`, this value is `''`. | `string` |\n| `group1` | The 1st captured group.                                                                        | `string` |\n| `group2` | The 2nd captured group.                                                                        | `string` |\n| `group3` | The 3rd captured group.                                                                        | `string` |\n| `group4` | The 4th captured group.                                                                        | `string` |\n| `group5` | The 5th captured group.                                                                        | `string` |\n| `group6` | The 6th captured group.                                                                        | `string` |\n| `group7` | The 7th captured group.                                                                        | `string` |\n| `group8` | The 8th captured group.                                                                        | `string` |\n| `group9` | The 9th captured group.                                                                        | `string` |\n\n## Example\n\n```yaml\nname: Add Label with Comment\n\non: [issue_comment]\n\njobs:\n  create_comment:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: actions-ecosystem/action-regex-match@v2\n        id: regex-match\n        with:\n          text: ${{ github.event.comment.body }}\n          regex: '^/label\\s*(.*?)\\s*$'\n\n      - uses: actions-ecosystem/action-add-labels@v1\n        if: ${{ steps.regex-match.outputs.match != '' }}\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          labels: ${{ steps.regex-match.outputs.group1 }}\n```\n\n```yaml\nname: Create Comment with Regex Match\n\non: [issue_comment]\n\njobs:\n  create_comment:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: actions-ecosystem/action-regex-match@v2\n        id: regex-match\n        with:\n          text: ${{ github.event.comment.body }}\n          regex: '```typescript([\\s\\S]*)```'\n          flags: gm\n\n      - uses: actions-ecosystem/action-create-comment@v1\n        if: ${{ steps.regex-match.outputs.match != '' }}\n        with:\n          github_token: ${{ secrets.github_token }}\n          body: |\n            Hello, @${{ github.actor }}!\n\n            The raw TypeScript code is here.\n\n            ---\n\n            ${{ steps.regex-match.outputs.group1 }}\n\n            ---\n```\n\n## License\n\nCopyright 2020 The Actions Ecosystem Authors.\n\nAction Regex Match is released under the [Apache License 2.0](./LICENSE).\n\n\u003c!-- badge links --\u003e\n\n[actions-workflow-test]: https://github.com/actions-ecosystem/action-regex-match/actions?query=workflow%3ATest\n[actions-workflow-test-badge]: https://img.shields.io/github/workflow/status/actions-ecosystem/action-regex-match/Test?label=Test\u0026style=for-the-badge\u0026logo=github\n\n[release]: https://github.com/actions-ecosystem/action-regex-match/releases\n[release-badge]: https://img.shields.io/github/v/release/actions-ecosystem/action-regex-match?style=for-the-badge\u0026logo=github\n\n[license]: LICENSE\n[license-badge]: https://img.shields.io/github/license/actions-ecosystem/action-add-labels?style=for-the-badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-regex-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factions-ecosystem%2Faction-regex-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-regex-match/lists"}