Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This action for [Changesets](https://github.com/atlassian/changesets) creates a
- setupGitUser - Sets up the git user for commits as `"github-actions[bot]"`. Default to `true`
- createGithubReleases - A boolean value to indicate whether to create Github releases after `publish` or not. Default to `true`
- cwd - Changes node's `process.cwd()` if the project is not located on the root. Default to `process.cwd()`
- createPrAsDraft - A boolean value to indicate whether to create the PR as draft or not. Default to `false`

### Outputs

Expand Down
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"),
branch: getOptionalInput("branch"),
});

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

Expand All @@ -314,6 +315,7 @@ export async function runVersion({
commitMessage = "Version Packages",
hasPublishScript = false,
prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE,
createPrAsDraft = false,
branch,
}: VersionOptions): Promise<RunVersionResult> {
const octokit = setupOctokit(githubToken);
Expand Down Expand Up @@ -398,6 +400,7 @@ export async function runVersion({
head: versionBranch,
title: finalPrTitle,
body: prBody,
draft: createPrAsDraft,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have the same validation when updating the PR in the block below.

Or create a new property for converting back to draft: updatePrConvertToDraft

...github.context.repo,
});

Expand Down