{"id":13995996,"url":"https://github.com/uiur/github-pr-release","last_synced_at":"2025-04-08T03:10:00.989Z","repository":{"id":26091700,"uuid":"29535734","full_name":"uiur/github-pr-release","owner":"uiur","description":"Create a release pull request using GitHub API","archived":false,"fork":false,"pushed_at":"2024-05-02T10:23:44.000Z","size":224,"stargazers_count":73,"open_issues_count":6,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T17:53:49.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/uiur.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":"2015-01-20T15:10:57.000Z","updated_at":"2025-02-01T18:54:08.000Z","dependencies_parsed_at":"2024-06-18T21:26:46.194Z","dependency_job_id":"ea066e7e-11a6-412b-ae68-7b16b1388d65","html_url":"https://github.com/uiur/github-pr-release","commit_stats":{"total_commits":109,"total_committers":7,"mean_commits":"15.571428571428571","dds":"0.22018348623853212","last_synced_commit":"76e01d275672cb75d0db550e36afb51ae5012390"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fgithub-pr-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fgithub-pr-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fgithub-pr-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fgithub-pr-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uiur","download_url":"https://codeload.github.com/uiur/github-pr-release/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478025,"owners_count":20945253,"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-08-09T14:03:43.420Z","updated_at":"2025-04-08T03:10:00.967Z","avatar_url":"https://github.com/uiur.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# github-pr-release\n\n[![](https://img.shields.io/npm/v/github-pr-release.svg)](https://www.npmjs.com/package/github-pr-release)\n\nCreate a release pull request using GitHub API. Inspired by [git-pr-release](https://github.com/motemen/git-pr-release).\n\n- No dependency on git. You can easily deploy it to Heroku / AWS Lambda / Google Cloud Functions etc.\n- Fast because it uses only Github API.\n- Written in TypeScript / JavaScript.\n\n[![Gyazo](http://i.gyazo.com/7484a59ade4e96ce9a015f1aa817cab8.png)](http://gyazo.com/7484a59ade4e96ce9a015f1aa817cab8)\n\n## Usage\n\n### API: release(config)\n\nCreate a release pull request and return Promise.\n\nYou must pass a config as an argument.\n\n```javascript\nconst release = require(\"github-pr-release\");\n\nconst config = {\n  token: \"your github token\",\n  owner: \"uiur\",\n  repo: \"awesome-web-app\",\n  head: \"master\", // optional\n  base: \"production\", // optional\n  template: \"/path/to/template.mustache\", // optional\n};\n\nrelease(config).then(function (pullRequest) {\n  // success\n  // `pullRequest` is an object that github api returns.\n  // See: https://developer.github.com/v3/pulls/#get-a-single-pull-request\n});\n```\n\nAlso, the following environment variables can be used for the config:\n\n- `GITHUB_PR_RELEASE_OWNER`\n- `GITHUB_PR_RELEASE_REPO`\n- `GITHUB_PR_RELEASE_TOKEN`\n- `GITHUB_PR_RELEASE_HEAD`\n- `GITHUB_PR_RELEASE_BASE`\n- `GITHUB_PR_RELEASE_ENDPOINT`\n\n### CLI\n\nYou can create a release pull request by the following command:\n\n```sh\n❯ npx github-pr-release owner/repo --head master --base production\n# `GITHUB_PR_RELEASE_TOKEN` is required\n```\n\n`--help`:\n\n```\n❯ npx github-pr-release --help\nUsage: github-pr-release [repo]\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n  --head                                                     [default: \"master\"]\n  --base                                                 [default: \"production\"]\n\nExamples:\n  github-pr-release uiur/github-pr-release --head master --base production\n```\n\n## Install\n\n```\nnpm install github-pr-release\n```\n\n## Tips\n\n### Pull request titles\n\nIf one of pull requests of which consist a release pull request has a title like \"Bump to v1.0\", the title of the release pull request becomes \"Release v1.0\". Otherwise, it uses timestamps like \"Release 2000-01-01 00:00:00\" in local timezone.\n\n### Specify a message format\n\nYou can specify a template to change the message format. Pass a template path to `config.template`.\n\n```javascript\nrelease({\n  token: 'token'\n  owner: 'uiur',\n  repo:  'awesome-web-app',\n  template: './template.mustache'\n})\n```\n\nThe default template is below. The first line is treated as the title.\n\n```mustache\nRelease {{version}}\n{{#prs}}\n- [ ] #{{number}} {{title}} {{#assignee}}@{{login}}{{/assignee}}{{^assignee}}{{#user}}@{{login}}{{/user}}{{/assignee}}\n{{/prs}}\n```\n\n### GitHub Enterprise\n\nIf you use this plugin in GitHub Enterprise, you can specify endpoint domain for GitHub Enterprise.\n\n```javascript\nrelease({\n  token: 'token'\n  owner: 'uiur',\n  repo:  'awesome-web-app',\n  endpoint: 'https://github.yourdomain.com/api/v3'\n})\n```\n\n## Example\n\n### GitHub Actions\n\nCreating release pull requests can be automated using GitHub Actions.\n\nCreate `.github/workflows/create-pr-release.yml` with the following content:\n\n```yml\nname: Create release pull requests\n\non:\n  push:\n    branches: [master]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v2\n        with:\n          node-version: 16.x\n          cache: \"yarn\"\n\n      - run: yarn install\n      - name: Create release pull requests\n        run: |\n          npx github-pr-release $GITHUB_REPOSITORY --head master --base production\n        env:\n          GITHUB_PR_RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### hubot\n\n![](http://i.gyazo.com/018755d09bbc857aeafdf48372912d79.png)\n\n```coffee\nrelease = require('github-pr-release')\nmodule.exports = (robot) -\u003e\n  robot.respond /release/i, (msg) -\u003e\n    release(config).then((pullRequest) -\u003e\n      msg.send pullRequest.html_url\n    )\n    .catch((err) -\u003e\n      msg.send(\"Create release PR failed: \" + err.message)\n    )\n```\n\n## Development\n\nThe release flow of github-pr-release is managed with github-pr-release itself.\n\nIt creates a release pull request when merging a topic branch or pushing to the main branch.\nThe update can be published by merging a release pull request.\n\nSee:\n\nhttps://github.com/uiur/github-pr-release/pulls?q=is%3Apr+is%3Aopen+Release\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiur%2Fgithub-pr-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuiur%2Fgithub-pr-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiur%2Fgithub-pr-release/lists"}