mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Add back cwd input (#718)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@changesets/action": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add a `cwd` input to the root action, `/select-mode`, `/version`, `/pack`, and `/publish` sub-actions to set the current working directory to execute Changesets in. This input existed in v1 but was incorrectly removed.
|
||||||
@@ -62,6 +62,7 @@ If using [trusted publishing](https://docs.npmjs.com/trusted-publishers), it's r
|
|||||||
| `create-github-releases` | Whether to create Github releases after publish |
|
| `create-github-releases` | Whether to create Github releases after publish |
|
||||||
| `push-git-tags` | Whether to create git tags after publish. If `create-github-releases` is set to `true`, this option will also always be `true`. |
|
| `push-git-tags` | Whether to create git tags after publish. If `create-github-releases` is set to `true`, this option will also always be `true`. |
|
||||||
| `push-with-git-cli` | Whether to use the Git CLI instead of the GitHub API to push release commits and tags. Defaults to `false`. When using the GitHub API, commits and tags are signed using GitHub's GPG key and attributed to the user or app that owns the `github-token`. |
|
| `push-with-git-cli` | Whether to use the Git CLI instead of the GitHub API to push release commits and tags. Defaults to `false`. When using the GitHub API, commits and tags are signed using GitHub's GPG key and attributed to the user or app that owns the `github-token`. |
|
||||||
|
| `cwd` | The working directory to execute Changesets in. Defaults to the root of the repository. |
|
||||||
|
|
||||||
| Outputs | Description |
|
| Outputs | Description |
|
||||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ inputs:
|
|||||||
GitHub's GPG key and attributed to the user or app that owns the `github-token`.
|
GitHub's GPG key and attributed to the user or app that owns the `github-token`.
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
cwd:
|
||||||
|
description: "The working directory to execute Changesets in. Defaults to the root of the repository."
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
published:
|
published:
|
||||||
description: A "true" or "false" string value to indicate whether a publishing is happened or not
|
description: A "true" or "false" string value to indicate whether a publishing is happened or not
|
||||||
|
|||||||
+2
-1
@@ -18,8 +18,9 @@ This action packs publishable packages into tarballs, complements [changesets/ac
|
|||||||
<!-- api-start -->
|
<!-- api-start -->
|
||||||
|
|
||||||
| Inputs | Description |
|
| Inputs | Description |
|
||||||
| -------------------------- | --------------------------------------------------------------------- |
|
| -------------------------- | --------------------------------------------------------------------------------------- |
|
||||||
| `publish-plan-artifact-id` | Artifact id for a publish plan generated by the select-mode subaction |
|
| `publish-plan-artifact-id` | Artifact id for a publish plan generated by the select-mode subaction |
|
||||||
|
| `cwd` | The working directory to execute Changesets in. Defaults to the root of the repository. |
|
||||||
|
|
||||||
| Outputs | Description |
|
| Outputs | Description |
|
||||||
| ---------------------- | ------------------------------------------- |
|
| ---------------------- | ------------------------------------------- |
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ inputs:
|
|||||||
publish-plan-artifact-id:
|
publish-plan-artifact-id:
|
||||||
description: "Artifact id for a publish plan generated by the select-mode subaction"
|
description: "Artifact id for a publish plan generated by the select-mode subaction"
|
||||||
required: false
|
required: false
|
||||||
|
cwd:
|
||||||
|
description: "The working directory to execute Changesets in. Defaults to the root of the repository."
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
pack-dir-artifact-id:
|
pack-dir-artifact-id:
|
||||||
description: "Artifact id for the packed output directory"
|
description: "Artifact id for the packed output directory"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ This action publishes packages to npm.
|
|||||||
| `pack-dir-artifact-id` | Artifact id for packed publish output generated by the pack subaction |
|
| `pack-dir-artifact-id` | Artifact id for packed publish output generated by the pack subaction |
|
||||||
| `create-github-releases` | Whether to create Github releases after publish |
|
| `create-github-releases` | Whether to create Github releases after publish |
|
||||||
| `push-git-tags` | Whether to create git tags after publish. If `create-github-releases` is set to `true`, this option will also always be `true`. |
|
| `push-git-tags` | Whether to create git tags after publish. If `create-github-releases` is set to `true`, this option will also always be `true`. |
|
||||||
|
| `cwd` | The working directory to execute Changesets in. Defaults to the root of the repository. |
|
||||||
|
|
||||||
| Outputs | Description |
|
| Outputs | Description |
|
||||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ inputs:
|
|||||||
this option will also always be `true`.
|
this option will also always be `true`.
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
|
cwd:
|
||||||
|
description: "The working directory to execute Changesets in. Defaults to the root of the repository."
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
published:
|
published:
|
||||||
description: A "true" or "false" string value to indicate whether a publishing has happened or not
|
description: A "true" or "false" string value to indicate whether a publishing has happened or not
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ This action selects the mode to run a Changesets workflow:
|
|||||||
|
|
||||||
<!-- api-start -->
|
<!-- api-start -->
|
||||||
|
|
||||||
Inputs: _none_
|
| Inputs | Description |
|
||||||
|
| ------ | --------------------------------------------------------------------------------------- |
|
||||||
|
| `cwd` | The working directory to execute Changesets in. Defaults to the root of the repository. |
|
||||||
|
|
||||||
| Outputs | Description |
|
| Outputs | Description |
|
||||||
| -------------------------- | ---------------------------------------------------------------------------- |
|
| -------------------------- | ---------------------------------------------------------------------------- |
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ description: Whether to version or publish in the current repo state
|
|||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node24
|
||||||
main: ../dist/select-mode.js
|
main: ../dist/select-mode.js
|
||||||
inputs: {}
|
inputs:
|
||||||
|
cwd:
|
||||||
|
description: "The working directory to execute Changesets in. Defaults to the root of the repository."
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
mode:
|
mode:
|
||||||
description: "The mode to use for the current repo state: 'version', 'publish', or 'none'."
|
description: "The mode to use for the current repo state: 'version', 'publish', or 'none'."
|
||||||
|
|||||||
+1
-2
@@ -11,8 +11,7 @@ import {
|
|||||||
} from "./utils.ts";
|
} from "./utils.ts";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// If the user needs to change the cwd, set `working-directory` in the step instead
|
const cwd = getOptionalInput("cwd") || process.cwd();
|
||||||
const cwd = process.cwd();
|
|
||||||
await validateChangesetsCliVersion(cwd);
|
await validateChangesetsCliVersion(cwd);
|
||||||
|
|
||||||
throwOnRenamedInputs({
|
throwOnRenamedInputs({
|
||||||
|
|||||||
+1
-2
@@ -17,8 +17,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// If the user needs to change the cwd, set `working-directory` in the step instead
|
const cwd = getOptionalInput("cwd") || process.cwd();
|
||||||
const cwd = process.cwd();
|
|
||||||
await validateChangesetsCliVersion(cwd);
|
await validateChangesetsCliVersion(cwd);
|
||||||
|
|
||||||
const publishPlanArtifactId = getOptionalInput("publish-plan-artifact-id");
|
const publishPlanArtifactId = getOptionalInput("publish-plan-artifact-id");
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// If the user needs to change the cwd, set `working-directory` in the step instead
|
const cwd = getOptionalInput("cwd") || process.cwd();
|
||||||
const cwd = process.cwd();
|
|
||||||
await validateChangesetsCliVersion(cwd);
|
await validateChangesetsCliVersion(cwd);
|
||||||
|
|
||||||
const githubToken = getRequiredInput("github-token");
|
const githubToken = getRequiredInput("github-token");
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import path from "node:path";
|
|||||||
import artifact from "@actions/artifact";
|
import artifact from "@actions/artifact";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import readChangesetState from "../readChangesetState.ts";
|
import readChangesetState from "../readChangesetState.ts";
|
||||||
import { execChangesetsCli, validateChangesetsCliVersion } from "../utils.ts";
|
import {
|
||||||
|
execChangesetsCli,
|
||||||
|
getOptionalInput,
|
||||||
|
validateChangesetsCliVersion,
|
||||||
|
} from "../utils.ts";
|
||||||
|
|
||||||
type ModeResult =
|
type ModeResult =
|
||||||
| {
|
| {
|
||||||
@@ -27,7 +31,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const cwd = process.cwd();
|
const cwd = getOptionalInput("cwd") || process.cwd();
|
||||||
await validateChangesetsCliVersion(cwd);
|
await validateChangesetsCliVersion(cwd);
|
||||||
|
|
||||||
const result = await getMode(cwd);
|
const result = await getMode(cwd);
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// If the user needs to change the cwd, set `working-directory` in the step instead
|
const cwd = getOptionalInput("cwd") || process.cwd();
|
||||||
const cwd = process.cwd();
|
|
||||||
await validateChangesetsCliVersion(cwd);
|
await validateChangesetsCliVersion(cwd);
|
||||||
throwOnRemovedCommitModeInput();
|
throwOnRemovedCommitModeInput();
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ This action versions packages and creates or updates a pull request with the cha
|
|||||||
| `pr-draft` | Controls draft PR behavior. Use 'create' to create new version PRs as draft, or 'always' to also convert existing version PRs back to draft when updating them. |
|
| `pr-draft` | Controls draft PR behavior. Use 'create' to create new version PRs as draft, or 'always' to also convert existing version PRs back to draft when updating them. |
|
||||||
| `pr-base-branch` | Sets the base branch of the PR. Defaults to `github.ref_name`. |
|
| `pr-base-branch` | Sets the base branch of the PR. Defaults to `github.ref_name`. |
|
||||||
| `push-with-git-cli` | Whether to use the Git CLI instead of the GitHub API to push release commits. Defaults to `false`. When using the GitHub API, commits are signed using GitHub's GPG key and attributed to the user or app that owns the `github-token`. |
|
| `push-with-git-cli` | Whether to use the Git CLI instead of the GitHub API to push release commits. Defaults to `false`. When using the GitHub API, commits are signed using GitHub's GPG key and attributed to the user or app that owns the `github-token`. |
|
||||||
|
| `cwd` | The working directory to execute Changesets in. Defaults to the root of the repository. |
|
||||||
|
|
||||||
| Outputs | Description |
|
| Outputs | Description |
|
||||||
| ----------- | --------------------------------------------------- |
|
| ----------- | --------------------------------------------------- |
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ inputs:
|
|||||||
GPG key and attributed to the user or app that owns the `github-token`.
|
GPG key and attributed to the user or app that owns the `github-token`.
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
cwd:
|
||||||
|
description: "The working directory to execute Changesets in. Defaults to the root of the repository."
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
pr-number:
|
pr-number:
|
||||||
description: The pull request number that was created or updated
|
description: The pull request number that was created or updated
|
||||||
|
|||||||
Reference in New Issue
Block a user