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 draft mode support #258

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add draft mode support
  • Loading branch information
tom-sherman committed Jan 25, 2023
commit 8bd54004fbc5d017a11437777dcd824602e7bb32
5 changes: 5 additions & 0 deletions .changeset/brown-cycles-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@changesets/action": minor
---

Support creating the pull request in draft mode
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
prTitle: getOptionalInput("title"),
commitMessage: getOptionalInput("commit"),
hasPublishScript,
createPrAsDraft: core.getBooleanInput("createPrAsDraft"),
});

core.setOutput("pullRequestNumber", String(pullRequestNumber));
Expand Down
3 changes: 3 additions & 0 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ type VersionOptions = {
commitMessage?: string;
hasPublishScript?: boolean;
prBodyMaxCharacters?: number;
createPrAsDraft?: boolean;
};

type RunVersionResult = {
Expand All @@ -265,6 +266,7 @@ export async function runVersion({
commitMessage = "Version Packages",
hasPublishScript = false,
prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE,
createPrAsDraft = false,
}: VersionOptions): Promise<RunVersionResult> {
let repo = `${github.context.repo.owner}/${github.context.repo.repo}`;
let branch = github.context.ref.replace("refs/heads/", "");
Expand Down Expand Up @@ -346,6 +348,7 @@ export async function runVersion({
head: versionBranch,
title: finalPrTitle,
body: prBody,
draft: createPrAsDraft,
...github.context.repo,
});

Expand Down