Skip to content

Commit

Permalink
fix(build): make copyFrom.targetPath default to `copyFrom.sourcePat…
Browse files Browse the repository at this point in the history
…h` (#5234)
  • Loading branch information
vvagaytsev committed Oct 13, 2023
1 parent 1a55cf7 commit 62567d7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
5 changes: 4 additions & 1 deletion core/src/actions/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export const copyFromSchema = createSchema({
.description(
"POSIX-style path or filename of the directory or file(s) to copy to the target, relative to the build path of the source build."
),
targetPath: joi.posixPath().subPathOnly().default("").description(dedent`
targetPath: joi
.posixPath()
.subPathOnly()
.default((parent) => parent.sourcePath).description(dedent`
POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
Defaults to to same as source path.
`),
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/action-types/Build/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ copyFrom:

# POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
# Defaults to to same as source path.
targetPath: ''
targetPath:

# Specify a list of POSIX-style paths or globs that should be included as the build context for the Build, and will
# affect the computed _version_ of the action.
Expand Down Expand Up @@ -422,9 +422,9 @@ POSIX-style path or filename of the directory or file(s) to copy to the target,
POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
Defaults to to same as source path.

| Type | Default | Required |
| ----------- | ------- | -------- |
| `posixPath` | `""` | No |
| Type | Required |
| ----------- | -------- |
| `posixPath` | No |

### `include[]`

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/action-types/Build/exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ copyFrom:

# POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
# Defaults to to same as source path.
targetPath: ''
targetPath:

# Specify a list of POSIX-style paths or globs that should be included as the build context for the Build, and will
# affect the computed _version_ of the action.
Expand Down Expand Up @@ -426,9 +426,9 @@ POSIX-style path or filename of the directory or file(s) to copy to the target,
POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
Defaults to to same as source path.

| Type | Default | Required |
| ----------- | ------- | -------- |
| `posixPath` | `""` | No |
| Type | Required |
| ----------- | -------- |
| `posixPath` | No |

### `include[]`

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/action-types/Build/jib-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ copyFrom:

# POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
# Defaults to to same as source path.
targetPath: ''
targetPath:

# Specify a list of POSIX-style paths or globs that should be included as the build context for the Build, and will
# affect the computed _version_ of the action.
Expand Down Expand Up @@ -496,9 +496,9 @@ POSIX-style path or filename of the directory or file(s) to copy to the target,
POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
Defaults to to same as source path.

| Type | Default | Required |
| ----------- | ------- | -------- |
| `posixPath` | `""` | No |
| Type | Required |
| ----------- | -------- |
| `posixPath` | No |

### `include[]`

Expand Down

0 comments on commit 62567d7

Please sign in to comment.