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

feat: draft option #705

Merged
merged 1 commit into from
Oct 2, 2024
Merged
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
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ inputs:
description: "Set to true if you want the title and body to be updated for an existing pull request"
default: "false"
required: false
draft:
description: "Set to true if you want the pull request to be in draft mode"
default: "false"
required: false

outputs:
pull-request-number:
Expand Down
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async function main() {
team_reviewers: core.getInput("team_reviewers"),
autoMerge: core.getInput("auto-merge"),
updatePRTitleAndBody: core.getInput("update-pull-request-title-and-body"),
draft: core.getInput("draft"),
};

core.debug(`Inputs: ${inspect(inputs)}`);
Expand Down Expand Up @@ -185,6 +186,7 @@ async function main() {
body: inputs.body,
head: inputs.branch,
base: DEFAULT_BRANCH,
draft: inputs.draft === "true",
});

core.info(`Pull request created: ${html_url} (#${number})`);
Expand Down Expand Up @@ -223,7 +225,7 @@ async function main() {
core.info(`Assignees added: ${assignees.join(", ")}`);
core.debug(inspect(data));
}

if (inputs.reviewers || inputs.team_reviewers) {
let params = {
owner,
Expand All @@ -233,8 +235,8 @@ async function main() {
let reviewers = null;
let team_reviewers = null;

if(inputs.reviewers) {
core.debug(`Adding reviewers: ${inputs.reviewers}`)
if(inputs.reviewers) {
core.debug(`Adding reviewers: ${inputs.reviewers}`)
reviewers = (inputs.reviewers || "").trim().split(/\s*,\s*/);

params = {
Expand All @@ -244,7 +246,7 @@ async function main() {
};

if(inputs.team_reviewers) {
core.debug(`Adding team reviewers: ${inputs.team_reviewers}`)
core.debug(`Adding team reviewers: ${inputs.team_reviewers}`)
team_reviewers = (inputs.team_reviewers || "").trim().split(/\s*,\s*/);

params = {
Expand Down
Loading