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:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@changesets/action": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Support creating the pull request in draft mode
|
||||||
@@ -109,6 +109,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
|
|||||||
prTitle: getOptionalInput("title"),
|
prTitle: getOptionalInput("title"),
|
||||||
commitMessage: getOptionalInput("commit"),
|
commitMessage: getOptionalInput("commit"),
|
||||||
hasPublishScript,
|
hasPublishScript,
|
||||||
|
createPrAsDraft: core.getBooleanInput("createPrAsDraft"),
|
||||||
});
|
});
|
||||||
|
|
||||||
core.setOutput("pullRequestNumber", String(pullRequestNumber));
|
core.setOutput("pullRequestNumber", String(pullRequestNumber));
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ type VersionOptions = {
|
|||||||
commitMessage?: string;
|
commitMessage?: string;
|
||||||
hasPublishScript?: boolean;
|
hasPublishScript?: boolean;
|
||||||
prBodyMaxCharacters?: number;
|
prBodyMaxCharacters?: number;
|
||||||
|
createPrAsDraft?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type RunVersionResult = {
|
type RunVersionResult = {
|
||||||
@@ -265,6 +266,7 @@ export async function runVersion({
|
|||||||
commitMessage = "Version Packages",
|
commitMessage = "Version Packages",
|
||||||
hasPublishScript = false,
|
hasPublishScript = false,
|
||||||
prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE,
|
prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE,
|
||||||
|
createPrAsDraft = false,
|
||||||
}: VersionOptions): Promise<RunVersionResult> {
|
}: VersionOptions): Promise<RunVersionResult> {
|
||||||
let repo = `${github.context.repo.owner}/${github.context.repo.repo}`;
|
let repo = `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||||
let branch = github.context.ref.replace("refs/heads/", "");
|
let branch = github.context.ref.replace("refs/heads/", "");
|
||||||
@@ -346,6 +348,7 @@ export async function runVersion({
|
|||||||
head: versionBranch,
|
head: versionBranch,
|
||||||
title: finalPrTitle,
|
title: finalPrTitle,
|
||||||
body: prBody,
|
body: prBody,
|
||||||
|
draft: createPrAsDraft,
|
||||||
...github.context.repo,
|
...github.context.repo,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user