mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Add draft mode support (#258)
* Add draft mode support * Add doc * fmt * add it to action.yml * fix bad merge? * tweak changeset * refactor --------- Co-authored-by: Emma Hamilton <mitchell@hamil.town> Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
co-authored by
Emma Hamilton
Mateusz Burzyński
parent
91b911142e
commit
f5dbf72f96
@@ -24,10 +24,15 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
|
||||
|
||||
const octokit = setupOctokit(githubToken);
|
||||
const commitMode = getOptionalInput("commitMode") ?? "git-cli";
|
||||
const prDraft = getOptionalInput("prDraft");
|
||||
if (commitMode !== "git-cli" && commitMode !== "github-api") {
|
||||
core.setFailed(`Invalid commit mode: ${commitMode}`);
|
||||
return;
|
||||
}
|
||||
if (prDraft !== undefined && prDraft !== "always" && prDraft !== "create") {
|
||||
core.setFailed(`Invalid prDraft: ${prDraft}`);
|
||||
return;
|
||||
}
|
||||
const git = new Git({
|
||||
octokit: commitMode === "github-api" ? octokit : undefined,
|
||||
cwd,
|
||||
@@ -147,6 +152,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
|
||||
prTitle: getOptionalInput("title"),
|
||||
commitMessage: getOptionalInput("commit"),
|
||||
hasPublishScript,
|
||||
prDraft,
|
||||
branch: getOptionalInput("branch"),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user