Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for draft prs #30

Merged
merged 10 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ What you would like in the body of the pull request.

Default: `sync-branches: New code has just landed in {FROM_BRANCH} so let's bring {TO_BRANCH} up to speed!`

### `PULL_REQUEST_IS_DRAFT`

Set to 'y' for the pull request to be opened as a draft.
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved

Default: 'n'
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved

## Outputs

### `PULL_REQUEST_URL`
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
PULL_REQUEST_BODY:
description: "What you would like in the body of the pull request. Default: 'New code has just landed in {fromBranch} so let's bring {toBranch} up to speed!'"
required: false
PULL_REQUEST_IS_DRAFT:
description: "Set to 'y' for the pull request to be opened as a draft. Default: 'n'"
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved
required: false
outputs:
PULL_REQUEST_URL:
description: "URL for either the generated pull request or the currently open one"
Expand Down
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,7 @@ async function run() {
const githubToken = core.getInput("GITHUB_TOKEN", { required: true });
const pullRequestTitle = core.getInput("PULL_REQUEST_TITLE");
const pullRequestBody = core.getInput("PULL_REQUEST_BODY");
const pullRequestIsDraft = core.getInput("PULL_REQUEST_IS_DRAFT");
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved

console.log(`Making a pull request to ${toBranch} from ${fromBranch}.`);

Expand Down Expand Up @@ -2017,7 +2018,8 @@ async function run() {
: `sync: ${fromBranch} to ${toBranch}`,
body: pullRequestBody
? pullRequestBody
: `sync-branches: New code has just landed in ${fromBranch}, so let's bring ${toBranch} up to speed!`
: `sync-branches: New code has just landed in ${fromBranch}, so let's bring ${toBranch} up to speed!`,
draft: pullRequestIsDraft === 'y'
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved
});

console.log(
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ async function run() {
const githubToken = core.getInput("GITHUB_TOKEN", { required: true });
const pullRequestTitle = core.getInput("PULL_REQUEST_TITLE");
const pullRequestBody = core.getInput("PULL_REQUEST_BODY");
const pullRequestIsDraft = core.getInput("PULL_REQUEST_IS_DRAFT");
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved

console.log(`Making a pull request to ${toBranch} from ${fromBranch}.`);

Expand Down Expand Up @@ -37,7 +38,8 @@ async function run() {
: `sync: ${fromBranch} to ${toBranch}`,
body: pullRequestBody
? pullRequestBody
: `sync-branches: New code has just landed in ${fromBranch}, so let's bring ${toBranch} up to speed!`
: `sync-branches: New code has just landed in ${fromBranch}, so let's bring ${toBranch} up to speed!`,
draft: pullRequestIsDraft === 'y'
lfkwtz marked this conversation as resolved.
Show resolved Hide resolved
});

console.log(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sync-branches",
"version": "1.0.0",
"version": "1.2.0",
"description": "GitHub Action to sync a branch when another one is updated",
"main": "index.js",
"author": "Tre Ammatuna <[email protected]>",
Expand Down