Compare commits

..
1 Commits
Author SHA1 Message Date
github-actions[bot] 6f58fe53ba v1.1.0 2022-01-07 15:43:11 +00:00
7 changed files with 16 additions and 45 deletions
-8
View File
@@ -1,13 +1,5 @@
# @changesets/action
## 1.2.0
### Minor Changes
- [#130](https://github.com/changesets/action/pull/130) [`5c0997b`](https://github.com/changesets/action/commit/5c0997b25e175ecf5e1723ba07210bbcea5d92fb) Thanks [@akphi](https://github.com/akphi)! - Added `createGithubReleases` input option (defaults to `true`) to control whether to create Github releases during publish or not.
* [#134](https://github.com/changesets/action/pull/134) [`1ed9bc2`](https://github.com/changesets/action/commit/1ed9bc24b7a56462c183eb815c8f4bdf0e2e5785) Thanks [@dmregister](https://github.com/dmregister)! - Added `cwd` input option that can be used in projects that are not in the root directory.
## 1.1.0
### Minor Changes
-1
View File
@@ -11,7 +11,6 @@ This action for [Changesets](https://github.com/atlassian/changesets) creates a
- commit - The commit message to use. Default to `Version Packages`
- title - The pull request title. Default to `Version Packages`
- setupGitUser - Sets up the git user for commits as `"github-actions[bot]"`. Default to `true`
- cwd - Changes node's `process.cwd()` if the project is not located on the root. Default to `process.cwd()`
### Outputs
-7
View File
@@ -10,9 +10,6 @@ inputs:
version:
description: "The command to update version, edit CHANGELOG, read and delete changesets. Default to `changeset version` if not provided"
required: false
cwd:
description: Sets the cwd for the node process. Default to `process.cwd()`
required: false
commit:
description: |
The commit message. Default to `Version Packages`
@@ -24,10 +21,6 @@ inputs:
description: Sets up the git user for commits as `"github-actions[bot]"`. Default to `true`
required: false
default: true
createGithubReleases:
description: "A boolean value to indicate whether to create Github releases after `publish` or not"
required: false
default: true
outputs:
published:
description: A boolean value to indicate whether a publishing is happened or not
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@changesets/action",
"version": "1.2.0",
"version": "1.1.0",
"main": "dist/index.js",
"license": "MIT",
"devDependencies": {
+1 -8
View File
@@ -14,7 +14,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
return;
}
let setupGitUser = core.getBooleanInput("setupGitUser");
let setupGitUser = core.getBooleanInput('setupGitUser');
if (setupGitUser) {
console.log("setting git user");
@@ -27,12 +27,6 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
`machine github.com\nlogin github-actions[bot]\npassword ${githubToken}`
);
const inputCwd = core.getInput("cwd");
if (inputCwd) {
console.log("changing directory to the one given as the input");
process.chdir(inputCwd);
}
let { changesets } = await readChangesetState();
let publishScript = core.getInput("publish");
@@ -84,7 +78,6 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
const result = await runPublish({
script: publishScript,
githubToken,
createGithubReleases: core.getBooleanInput("createGithubReleases"),
});
if (result.published) {
-6
View File
@@ -51,7 +51,6 @@ const createRelease = async (
type PublishOptions = {
script: string;
githubToken: string;
createGithubReleases: boolean;
cwd?: string;
};
@@ -69,7 +68,6 @@ type PublishResult =
export async function runPublish({
script,
githubToken,
createGithubReleases,
cwd = process.cwd(),
}: PublishOptions): Promise<PublishResult> {
let octokit = github.getOctokit(githubToken);
@@ -106,7 +104,6 @@ export async function runPublish({
releasedPackages.push(pkg);
}
if (createGithubReleases) {
await Promise.all(
releasedPackages.map((pkg) =>
createRelease(octokit, {
@@ -115,7 +112,6 @@ export async function runPublish({
})
)
);
}
} else {
if (packages.length === 0) {
throw new Error(
@@ -131,12 +127,10 @@ export async function runPublish({
if (match) {
releasedPackages.push(pkg);
if (createGithubReleases) {
await createRelease(octokit, {
pkg,
tagName: `v${pkg.packageJson.version}`,
});
}
break;
}
}