mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Add draft mode support
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -251,6 +251,7 @@ type VersionOptions = {
|
||||
commitMessage?: string;
|
||||
hasPublishScript?: boolean;
|
||||
prBodyMaxCharacters?: number;
|
||||
createPrAsDraft?: boolean;
|
||||
};
|
||||
|
||||
type RunVersionResult = {
|
||||
@@ -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/", "");
|
||||
@@ -346,6 +348,7 @@ export async function runVersion({
|
||||
head: versionBranch,
|
||||
title: finalPrTitle,
|
||||
body: prBody,
|
||||
draft: createPrAsDraft,
|
||||
...github.context.repo,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user