{"id":19860864,"url":"https://github.com/semantic-release/issue-parser","last_synced_at":"2025-04-05T04:10:44.027Z","repository":{"id":57278249,"uuid":"113115546","full_name":"semantic-release/issue-parser","owner":"semantic-release","description":"Parser for Github, GitLab and Bitbucket issues actions, references and mentions","archived":false,"fork":false,"pushed_at":"2024-10-29T16:52:00.000Z","size":377,"stargazers_count":22,"open_issues_count":5,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T23:52:03.517Z","etag":null,"topics":["bitbucket","close","duplicate","fix","github","gitlab","issues","mentions","parser","pr","pull-request","references","resolve","waffle","waffle-io"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/semantic-release.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-12-05T01:27:13.000Z","updated_at":"2024-10-27T13:49:10.000Z","dependencies_parsed_at":"2024-04-15T14:26:29.713Z","dependency_job_id":"2dc8a379-1217-4881-bbfa-2a2c64465ef1","html_url":"https://github.com/semantic-release/issue-parser","commit_stats":{"total_commits":104,"total_committers":8,"mean_commits":13.0,"dds":0.6057692307692308,"last_synced_commit":"7c33475dceaf5557ba33194f3e4cc0972bf983ba"},"previous_names":["pvdlg/issue-parser"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fissue-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fissue-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fissue-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fissue-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semantic-release","download_url":"https://codeload.github.com/semantic-release/issue-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"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":["bitbucket","close","duplicate","fix","github","gitlab","issues","mentions","parser","pr","pull-request","references","resolve","waffle","waffle-io"],"created_at":"2024-11-12T15:07:24.565Z","updated_at":"2025-04-05T04:10:43.999Z","avatar_url":"https://github.com/semantic-release.png","language":"JavaScript","readme":"# issue-parser\n\nParser for [Github](https://github.com), [GitLab](https://gitlab.com) and [Bitbucket](https://bitbucket.org) issues actions, references and mentions\n\n\u003c!--status-badges start --\u003e\n\n[![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]\n\n\u003c!--status-badges end --\u003e\n\nThe parser can identify:\n- GitHub [closing keywords](https://help.github.com/articles/closing-issues-using-keywords), [duplicate keyword](https://help.github.com/articles/about-duplicate-issues-and-pull-requests), [issue references](https://guides.github.com/features/issues/#notifications) and [user mentions](https://guides.github.com/features/issues/#notifications)\n- GitLab [closing keywords](https://docs.gitlab.com/ee/user/project/issues/automatic_issue_closing.html), [duplicate keyword](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12845), [issue references](https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected) and [user mentions](https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected)\n- Bitbucket [closing keywords](https://confluence.atlassian.com/bitbucket/resolve-issues-automatically-when-users-push-code-221451126.html), [issue references](https://confluence.atlassian.com/bitbucket/mark-up-comments-issues-and-commit-messages-321859781.html) and [user mentions](https://confluence.atlassian.com/bitbucket/mark-up-comments-issues-and-commit-messages-321859781.html)\n- [Custom](#custom-format) or [additional](#extend-existing-format) keywords\n\n## Install\n\n```bash\n$ npm install --save issue-parser\n```\n\n## Usage\n\n### GitHub format\n\n```js\nconst issueParser = require('issue-parser');\nconst parse = issueParser('github');\n\nparse('Issue description, ref user/package#1, Fix #2, Duplicate of #3 /cc @user');\n/*\n{\n  refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}],\n  actions: {\n    close: [{raw: 'Fix #2', action: 'Fix', prefix: '#', issue: '2'}],\n    duplicate: [{raw: 'Duplicate of #3', action: 'Duplicate of', prefix: '#', issue: '3'}],\n  },\n  mentions: [{raw: '@user', prefix: '@', user: 'user'}],\n}\n*/\n```\n\n### GitLab format\n\n```js\nconst issueParser = require('issue-parser');\nconst parse = issueParser('gitlab');\n\nparse('Issue description, ref group/user/package#1, !2, implement #3, /duplicate #4 /cc @user');\n/*\n{\n  refs: [\n    {raw: 'group/user/package#1', slug: 'group/user/package', prefix: '#', issue: '1'},\n    {raw: '!2', slug: 'group/user/package', prefix: '!', issue: '2'},\n  ],\n  actions: {\n    close: [{raw: 'implement #3', action: 'Implement', prefix: '#', issue: '4'}],\n    duplicate: [{raw: 'Duplicate of #4', action: 'Duplicate of', prefix: '#', issue: '4'}],\n  },\n  mentions: [{raw: '@user', prefix: '@', user: 'user'}],\n}\n*/\n```\n\n### Bitbucket format\n\n```js\nconst issueParser = require('issue-parser');\nconst parse = issueParser('bitbucket');\n\nparse('Issue description, ref user/package#1, fixing #2. /cc @user');\n/*\n{\n  refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}],\n  actions: {\n    close: [{raw: 'fixing #2', action: 'Fixing', prefix: '#', issue: '2'}],\n  },\n  mentions: [{raw: '@user', prefix: '@', user: 'user'}],\n}\n*/\n```\n\n### Custom format\n\n```js\nconst issueParser = require('issue-parser');\nconst parse = issueParser({actions: {fix: ['complete'], hold: ['holds up']}, issuePrefixes: ['🐛']});\n\nparse('Issue description, related to user/package🐛1, Complete 🐛2, holds up 🐛3');\n/*\n{\n  refs: [{raw: 'user/package🐛1', slug: 'user/package', prefix: '🐛', issue: '1'}],\n  actions: {\n    fix: [{raw: 'Complete 🐛2', action: 'Complete', prefix: '🐛', issue: '2'}],\n    hold: [{raw: 'holds up 🐛3', action: 'Holds up', prefix: '🐛', issue: '3'}],\n  },\n}\n*/\n```\n\n### Extend existing format\n\n```js\nconst issueParser = require('issue-parser');\nconst parse = issueParser('github', {actions: {parent: ['parent of'], related: ['related to']}});\n\nparse('Issue description, ref user/package#1, Fix #2, Parent of #3, related to #4 /cc @user');\n/*\n{\n  refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}],\n  actions: {\n    close: [{raw: 'Fix #2', action: 'Fix', prefix: '#', issue: '2'}],\n    parent: [{raw: 'Parent of #3', action: 'Parent of', prefix: '#', issue: '3'}],\n    related: [{raw: 'related to #4', action: 'Related to', prefix: '#', issue: '4'}],\n  },\n  mentions: [{raw: '@user', prefix: '@', user: 'user'}],\n}\n*/\n```\n\n## Features\n\n### Parse references\n\n```text\n#1\n```\n```js\n{refs: [{raw: '#1', slug: undefined, prefix: '#', issue: '1'}]}\n```\n\n### Parse repository slug\n\n```text\nowner/repo#1\n```\n```js\n{refs: [{raw: 'owner/repo#1', slug: 'owner/repo', prefix: '#', issue: '1'}]}\n```\n\n### Parse closing keywords\n\n```text\nFix #1\n```\n```js\n{actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}\n```\n\n### Parse duplicate keywords\n\n```text\nDuplicate of #1\n```\n```js\n{actions: {duplicate: [{raw: 'Duplicate of #1', action: 'Duplicate of', slug: undefined, prefix: '#', issue: '1'}]}}\n```\n\n### Parse user mentions\n\n```text\n@user\n```\n```js\n{mentions: [{raw: '@user', prefix: '@', user: 'user'}]}\n```\n\n### Parse references with full issue URL\n\n```text\nhttps://github.com/owner/repo/pull/1\n\nFix https://github.com/owner/repo/issues/2\n```\n```js\n{\n  refs: [{raw: 'https://github.com/owner/repo/pull/1', slug: 'owner/repo', prefix: undefined, issue: '1'},]\n  actions: {\n    close: [\n      {raw: 'Fix https://github.com/owner/repo/issues/2', action: 'Fix', slug: 'owner/repo', prefix: undefined, issue: '2'}\n    ]\n  }\n}\n```\n\n### Ignore keywords case\n\n```text\nFIX #1\n```\n```js\n{actions: {close: [{raw: 'FIX #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}\n```\n\n### Support delimiters between action keyword and issue\n\n```text\nFix: #1\n```\n```js\n{actions: {close: [{raw: 'Fix: #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}\n```\n\n### Ignore references in back-tick quotes\n\n```text\nFix #1 `Fix #2` @user1 `@user2`\n```\n```js\n{\n  actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]},\n  mentions: [{raw: '@user1', prefix: '@', user: 'user1'}]\n}\n```\n\n### Include references in escaped back-tick quotes\n\n```text\n\\`Fix #1\\` \\`@user\\`\n```\n```js\n{\n  actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]},\n  mentions: [{raw: '@user1', prefix: '@', user: 'user1'}]\n}\n```\n\n### Ignore references in fenced blocks\n\n````text\nFix #1\n\n```js\nconsole.log('Fix #2');\n```\n\n@user1\n\n```js\nconsole.log('@user2');\n```\n````\n```js\n{\n  actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]},\n  mentions: [{raw: '@user1', prefix: '@', user: 'user1'}]\n}\n```\n\n### Include references in escaped fenced blocks\n\n```text\n\\`\\`\\`\nFix #1\n\\`\\`\\`\n\n\\`\\`\\`\n@user\n\\`\\`\\`\n```\n```js\n{\n  actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]},\n  mentions: [{raw: '@user', prefix: '@', user: 'user'}]\n}\n```\n\n### Ignore references in \u0026lt;code\u0026gt; tags\n\n```text\nFix #1\n\u003ccode\u003eFix #2\u003c/code\u003e\n\u003ccode\u003e\u003ccode\u003eFix #3\u003c/code\u003e\u003c/code\u003e\n@user1\n\u003ccode\u003e@user2\u003c/code\u003e\n```\n```js\n{\n  actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]},\n  mentions: [{raw: '@user1', prefix: '@', user: 'user1'}]\n}\n```\n\n### Include references in escaped \u0026lt;code\u0026gt; tags\n\n```text\n`\u003ccode\u003e`Fix #1`\u003c/code\u003e`\n`\u003ccode\u003e`@user`\u003c/code\u003e`\n```\n```js\n{\n  actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]},\n  mentions: [{raw: '@user', prefix: '@', user: 'user'}]\n}\n```\n\n### Ignore malformed references\n\n```text\nFix #1 Fix #2a Fix a#3\n```\n```js\n{actions: {close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}]}}\n```\n\n## API\n\n### issueParser([options], [overrides]) =\u003e parse\n\nCreate a [parser](#parsetext--result).\n\n#### options\n\nType: `Object` `String`\u003cbr\u003e\nParser options. Can be `github`, `gitlab` or `bitbucket` for predefined options, or an object for custom options.\n\n##### actions\n\nType: `Object`\u003cbr\u003e\nDefault:\n`{close: ['close', 'closes', 'closed', 'closing', 'fix', 'fixes', 'fixed', 'fixing', 'resolve', 'resolves', 'resolved', 'resolving', 'implement', 'implements', 'implemented', 'implementing'],\n  duplicate: ['Duplicate of', '/duplicate']}`\n\nObject with type of action as key and array of keywords as value.\n\nEach keyword match will be placed in the corresponding property of the [`result`](#result) `action` object. For example the with the configuration `{actions: fix: ['fixed', 'fixing']}` each action matching `fixed` or  `fixing` will be under `result.actions.fix`.\n\n##### delimiters\n\nType: `Array\u003cString\u003e` `String`\u003cbr\u003e\nDefault: `[':']`\n\nList of delimiter characters allowed between an action keywords and the issue reference. The characters space (` `) and tab (`  `) are always allowed.\n\n##### mentionsPrefixes\n\nType: `Array\u003cString\u003e` `String`\u003cbr\u003e\nDefault: `['@']`\n\nList of keywords used to identify user mentions.\n\n##### issuePrefixes\n\nType: `Array\u003cString\u003e` `String`\u003cbr\u003e\nDefault: `['#', 'gh-']`\n\nList of keywords used to identify issues and pull requests.\n\n##### hosts\n\nType: `Array\u003cString\u003e` `String`\u003cbr\u003e\nDefault: `['https://github.com', 'https://gitlab.com']`\n\nList of base URL used to identify issues and pull requests with [full URL](#parse-references-with-full-issue-url).\n\n##### issueURLSegments\n\nType: `Array\u003cString\u003e` `String`\u003cbr\u003e\nDefault: `['issues', 'pull', 'merge_requests']`\n\nList of URL segment used to identify issues and pull requests with [full URL](#parse-references-with-full-issue-url).\n\n#### overrides\n\nType: `Object`\u003cbr\u003e\nOption overrides. Useful when using predefined [`options`](#options) (such as `github`, `gitlab` or `bitbucket`). The `overrides` object can define the same properties as [`options`](#options).\n\nFor example, the following will use all the `github` predefined options but with a different `hosts` option:\n```js\nconst issueParser = require('issue-parser');\nconst parse = issueParser('github', {hosts: ['https://custom-url.com']});\n```\n\n### parse(text) =\u003e Result\n\nParse an issue description and returns a [Result](#result) object.\n\n#### text\n\nType: `String`\n\nIssue text to parse.\n\n### Result\n\n#### actions\n\nType: `Object`\n\nList of matching actions by type.\u003cbr\u003e\nEach type of action is an array of objects with the following properties:\n\n| Name   | Type     | Description                                                                           |\n|--------|----------|---------------------------------------------------------------------------------------|\n| raw    | `String` | The raw value parsed, for example `Fix #1`.                                           |\n| action | `String` | The keyword used to identify the action, capitalized.                                 |\n| slug   | `String` | The repository owner and name, for issue referred as `\u003cowner\u003e/\u003crepo\u003e#\u003cissue number\u003e`. |\n| prefix | `String` | The prefix used to identify the issue.                                                |\n| issue  | `String` | The issue number.                                                                     |\n\n#### refs\n\nType: `Array\u003cObject\u003e`\n\nList of issues and pull requests referenced, but not matched with an action.\u003cbr\u003e\nEach reference has the following properties:\n\n| Name   | Type     | Description                                                                           |\n|--------|----------|---------------------------------------------------------------------------------------|\n| raw    | `String` | The raw value parsed, for example `#1`.                                               |\n| slug   | `String` | The repository owner and name, for issue referred as `\u003cowner\u003e/\u003crepo\u003e#\u003cissue number\u003e`. |\n| prefix | `String` | The prefix used to identify the issue.                                                |\n| issue  | `String` | The issue number.                                                                     |\n\n#### mentions\n\nType: `Array\u003cObject\u003e`\n\nList of users mentioned.\u003cbr\u003e\nEach mention has the following properties:\n\n| Name   | Type     | Description                                 |\n|--------|----------|---------------------------------------------|\n| raw    | `String` | The raw value parsed, for example `@user`.  |\n| prefix | `String` | The prefix used to identify the mention.    |\n| user   | `String` | The user name                               |\n\n#### allRefs\n\nType: `Array\u003cObject\u003e`\n\nList of all issues and pull requests [referenced](#refs) or matching an [action](#actions-1).\u003cbr\u003e\nEach reference has the following properties:\n\n| Name   | Type     | Description                                                                                          |\n|--------|----------|------------------------------------------------------------------------------------------------------|\n| raw    | `String` | The raw value parsed, for example `Fix #1`.                                                          |\n| action | `String` | The keyword used to identify the action or the duplicate, capitalized. Only if matched by an action. |\n| slug   | `String` | The repository owner and name, for issue referred as `\u003cowner\u003e/\u003crepo\u003e#\u003cissue number\u003e`.                |\n| prefix | `String` | The prefix used to identify the issue.                                                               |\n| issue  | `String` | The issue number.                                                                                    |\n\n\n[github-actions-ci-link]: https://github.com/semantic-release/issue-parser/actions/workflows/test.yml\n\n[github-actions-ci-badge]: https://github.com/semantic-release/issue-parser/actions/workflows/test.yml/badge.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemantic-release%2Fissue-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemantic-release%2Fissue-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemantic-release%2Fissue-parser/lists"}