在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:uiur/github-pr-release开源软件地址:https://github.com/uiur/github-pr-release开源编程语言:JavaScript 98.6%开源软件介绍:github-pr-releaseCreate a release pull request using GitHub API. Inspired by git-pr-release.
UsageAPI: release(config)Create a release pull request and return Promise. You must pass a config as an argument. const release = require("github-pr-release");
const config = {
token: "your github token",
owner: "uiur",
repo: "awesome-web-app",
head: "master", // optional
base: "production", // optional
template: "/path/to/template.mustache", // optional
};
release(config).then(function (pullRequest) {
// success
// `pullRequest` is an object that github api returns.
// See: https://developer.github.com/v3/pulls/#get-a-single-pull-request
}); Also, the following environment variables can be used for the config:
CLIYou can create a release pull request by the following command: ❯ npx github-pr-release owner/repo --head master --base production
# `GITHUB_PR_RELEASE_TOKEN` is required
Install
TipsPull request titlesIf 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. Specify a message formatYou can specify a template to change the message format. Pass a template path to release({
token: 'token'
owner: 'uiur',
repo: 'awesome-web-app',
template: './template.mustache'
}) The default template is below. The first line is treated as the title. Release {{version}}
{{#prs}}
- [ ] #{{number}} {{title}} {{#assignee}}@{{login}}{{/assignee}}{{^assignee}}{{#user}}@{{login}}{{/user}}{{/assignee}}
{{/prs}} GitHub EnterpriseIf you use this plugin in GitHub Enterprise, you can specify endpoint domain for GitHub Enterprise. release({
token: 'token'
owner: 'uiur',
repo: 'awesome-web-app',
endpoint: 'https://github.yourdomain.com/api/v3'
}) ExampleGitHub ActionsCreating release pull requests can be automated using GitHub Actions. Create name: Create release pull requests
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: "yarn"
- run: yarn install
- name: Create release pull requests
run: |
npx github-pr-release $GITHUB_REPOSITORY --head master --base production
env:
GITHUB_PR_RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }} hubotrelease = require('github-pr-release')
module.exports = (robot) ->
robot.respond /release/i, (msg) ->
release(config).then((pullRequest) ->
msg.send pullRequest.html_url
)
.catch((err) ->
msg.send("Create release PR failed: " + err.message)
) DevelopmentThe release flow of github-pr-release is managed with github-pr-release itself. It creates a release pull request when merging a topic branch or pushing to the main branch. The update can be published by merging a release pull request. LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论