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:
Tom Sherman
2026-05-07 11:35:24 +02:00
committed by GitHub
co-authored by Emma Hamilton Mateusz Burzyński
parent 91b911142e
commit f5dbf72f96
7 changed files with 281 additions and 4 deletions
+6
View File
@@ -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"),
});