Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ Create a release pull request using GitHub API. Inspired by [git-pr-release](htt

- No dependency on git. You can easily deploy it to Heroku / AWS Lambda / Google Cloud Functions etc.
- Fast because it uses only Github API.
- Written in JavaScript.
- Written in TypeScript / JavaScript.

[![Gyazo](http://i.gyazo.com/7484a59ade4e96ce9a015f1aa817cab8.png)](http://gyazo.com/7484a59ade4e96ce9a015f1aa817cab8)

## Usage

<<<<<<< HEAD

### release(config)

=======

### API: release(config)

> > > > > > > origin/master

Create a release pull request and return Promise.

You must pass a config as an argument.
Expand Down Expand Up @@ -183,6 +175,10 @@ The 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.

See:

https://github.com/uiur/github-pr-release/pulls?q=is%3Apr+is%3Aopen+Release

## License

MIT
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/github-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class GithubClient {

return await this.get(this.pullRequestEndpoint(), {
state: "closed",
base: this.head,
base: this.head.split(":").at(-1),
per_page: 100,
sort: "updated",
direction: "desc",
Expand Down
26 changes: 26 additions & 0 deletions test/github-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,32 @@ describe("GithubClient", function () {
});
});

describe("#collectReleasePRs(): head option with `org:`", function () {
nock("https://api.github.com")
.get("/repos/uiureo/awesome-app/pulls/42/commits")
.query(true)
.reply(200, [])
.get(
"/repos/uiureo/awesome-app/pulls?state=closed&base=branch&per_page=100&sort=updated&direction=desc"
)
.reply(200, []);

it("returns prs that is going to be released", function (done) {
const client = new GithubClient({
owner: "uiureo",
repo: "awesome-app",
head: "org:branch",
});
client
.collectReleasePRs({ number: 42 })
.then(function (prs) {
assert(prs.length === 0);
done();
})
.catch(done);
});
});

describe("#assignReviewers()", function () {
const USER1 = "pr1-owner";
const USER2 = "pr2-owner";
Expand Down