{"id":15042366,"url":"https://github.com/chemaclass/create-pr","last_synced_at":"2025-10-19T15:20:10.184Z","repository":{"id":255025326,"uuid":"848260544","full_name":"Chemaclass/create-pr","owner":"Chemaclass","description":"A bash script to create PR based on your branch and context.","archived":false,"fork":false,"pushed_at":"2024-10-28T13:19:51.000Z","size":311,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T20:15:54.273Z","etag":null,"topics":["automation","bash","pull-requests"],"latest_commit_sha":null,"homepage":"https://chemaclass.com/","language":"Shell","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/Chemaclass.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/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},"funding":{"custom":["https://chemaclass.com/sponsor"]}},"created_at":"2024-08-27T12:43:42.000Z","updated_at":"2025-04-12T14:57:07.000Z","dependencies_parsed_at":"2024-08-27T15:57:12.393Z","dependency_job_id":"11273408-876d-4ac7-af62-04a94c25307a","html_url":"https://github.com/Chemaclass/create-pr","commit_stats":null,"previous_names":["chemaclass/bash-create-pr","chemaclass/create-pr"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fcreate-pr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fcreate-pr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fcreate-pr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fcreate-pr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chemaclass","download_url":"https://codeload.github.com/Chemaclass/create-pr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248960730,"owners_count":21189987,"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":["automation","bash","pull-requests"],"created_at":"2024-09-24T20:47:10.598Z","updated_at":"2025-10-19T15:20:05.136Z","avatar_url":"https://github.com/Chemaclass.png","language":"Shell","funding_links":["https://chemaclass.com/sponsor"],"categories":[],"sub_categories":[],"readme":"# create-pr\n\nA bash script that helps create your PRs.\nIt normalizes the PR title, description, assignee by default, and initial label based on your branch name.\n\n## Current support\n\n- **GitHub** requires https://cli.github.com/manual/gh_pr_create\n- **GitLab** requires https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/mr/create.md\n\n\u003e These are needed to access your client via the terminal, and they are independent of this script.\n\n### Extra arguments\n\nAny additional argument will be passed to `gh` or `glab` tool.\n\n```bash\n# Create a draft PR\n./create-pr --draft\n\n# Create a draft PR with an overridden title\n./create-pr --draft --title=\"Custom Title\"\n```\n\n* GitHub: https://cli.github.com/manual/gh_pr_create\n* GitLab: https://gitlab.com/gitlab-org/cli/-/blob/main/docs/source/mr/create.md\n\n## Installation\n\nYou can download the latest `single executable script` on the [Releases page](https://github.com/Chemaclass/bash-create-pr/releases) or build it yourself.\n\nIf you download the executable file from a release's GitHub project, you can check the file's checksum to validate that\nit was not altered. The checksum for each release is on each release on GitHub.\n\nTo build the project yourself, execute the script `./build.sh` and move the resulting `bin/create-pr` script wherever you want.\n\n## How to use it?\n\nThe script is customizable via `.env` variables. See [.env.example](.env.example).\n\n### PR_TEMPLATE_PATH\n\nDefine the path to locate the PR template. See [template example](.github/PULL_REQUEST_TEMPLATE.md).\n\n#### Example\n\n```bash\nPR_TEMPLATE_PATH=.github/PULL_REQUEST_TEMPLATE.md\n```\n\n#### Placeholders\n\n- `{{ TICKET_LINK }}`\n    - Uses `PR_TICKET_LINK_PREFIX` appending the ticket key and number to form the full URL\n- `{{ BACKGROUND }}`\n    - if the link is found: `Details in the ticket`\n    - if the link is not found: `Provide some context to the reviewer before jumping in the code`\n- You can define them inside a comment (to avoid rendering the placeholders when creating a PR without this script)\n    - eg `\u003c!-- {{ TICKET_LINK }} --\u003e`\n\n### PR_LINK_PREFIX_TEXT\n\nText to display if the link does not contain a `TICKET_KEY`.\n\n#### Example\n\nBranch name: `feat/27-my-branch-name`\n\n```bash\nPR_TICKET_LINK_PREFIX=\"https://github.com/Chemaclass/create-pr/issues/\"\nPR_LINK_PREFIX_TEXT=\"Closes: \"\n```\n\n- Result: `Closes: https://github.com/Chemaclass/create-pr/issues/27`\n\n### PR_TITLE_TEMPLATE\n\nEnable custom PR title with placeholders:\n\n- `{{TICKET_NUMBER}}`\n- `{{TICKET_KEY}}`\n- `{{PR_TITLE}}`\n\n#### Example\n\n```bash\nPR_TITLE_TEMPLATE=\"{{TICKET_KEY}}-{{TICKET_NUMBER}} {{PR_TITLE}}\"\n```\n\n### PR_TITLE_REMOVE_PREFIX\n\nRemove custom prefix text from the generated title.\nUseful when you have tickets prefixed with some text like `BE:` or `FE:`.\n\n#### Example\n\nBy default, having a branch named: `feat/ticket-123-be-crete-feature-foo`\n\nDefault behaviour:\n- `TICKET-123 Be create feature foo`\n\nWith `PR_TITLE_REMOVE_PREFIX=be` the result will be:\n- `TICKET-123 Create feature foo`\n\n\u003e This variable accept multiple strings to consider/remove comma separated.\n\u003e\n\u003e Eg: `PR_TITLE_REMOVE_PREFIX=be,fe`\n\n### PR_LABEL\n\n\u003e Alias: LABEL\n\nDefine a label for the PR.\n\n#### Example\n\n```bash\nPR_LABEL=enhancement\n```\n\nIf empty, extract the label from the branch's prefix - see `PR_LABEL_MAPPING`.\n\n### PR_LABEL_MAPPING\n\nDefine a mapping from prefix branches to GitHub label.\n\n#### Example\n\n```bash\nPR_LABEL_MAPPING=\"docs:documentation; fix|bug|bugfix|hotfix:bug; default:enhancement\"\n```\n\n- eg `docs/your-branch` -\u003e `documentation` label\n- eg `fix/your-branch` -\u003e `bug` label\n- eg `bug/your-branch` -\u003e `bug` label\n- eg `unknown/your-branch` -\u003e `enhancement` label\n\n### PR_ASSIGNEE\n\n\u003e Alias: ASSIGNEE\n\n- `PR_ASSIGNEE` or `@me` by default\n\n### PR_REVIEWER\n\n\u003e Alias: REVIEWER\n\n- Empty by default\n\n### TARGET_BRANCH\n\n- `TARGET_BRANCH` or `main` by default\n\n## HINTS\n\n- Add to your composer, npm or similar a script pointing to the `create-pr`\n- You can use the [PULL_REQUEST_TEMPLATE](./.github/PULL_REQUEST_TEMPLATE.md) from this project as example\n\n## Contribute\n\nSuggestions, ideas and PRs are more than welcome here!\nPlease, Check out our [CONTRIBUTING.md](.github/CONTRIBUTING.md) guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemaclass%2Fcreate-pr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchemaclass%2Fcreate-pr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemaclass%2Fcreate-pr/lists"}