Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,50 @@ location to another.
|------|------|----------|-------------|
| `inPath` | `string` | Y | Path to the file or directory to be copied. This path is relative to the temporary workspace that Kargo provisions for use by the promotion process. |
| `outPath` | `string` | Y | Path to the destination. This path is relative to the temporary workspace that Kargo provisions for use by the promotion process. |
| `ignore` | `string` | N | A multiline string of glob patterns to ignore when copying files. It accepts the same syntax as `.gitignore` files. |

Directories are copied recursively. If the destination directory already exists,
its contents are merged with those of the source. Existing destination files are
overwritten.

:::note
Symlinks encountered in the source are skipped.

`.git` is ignored by default. Because user-supplied `ignore` patterns are evaluated after that
default, a negation such as `!.git/` re-includes it.
:::
Comment on lines +23 to +28

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.gitdirectories are always ignored, regardless of theignore` patterns.

This isn't true. We even have a test for this that allows overriding default ignore rules that asserts a file in .git is included by using "!.git/"

https://github.com/akuity/kargo/blob/main/pkg/promotion/runner/builtin/file_copier_test.go#L302

So I would change that portion to something like:

".git is ignored by default but can be overridden by a user-supplied negation pattern"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I read the code wrong the first time. My bad.
I updated the PR, thanks for the review!


## Examples

### Basic Usage

Copy the contents of one directory to another:

```yaml
steps:
- uses: copy
config:
inPath: ./src/manifests
outPath: ./out/manifests
```

### Ignore Patterns

Copy a directory while excluding some of its contents:

```yaml
steps:
- uses: copy
config:
inPath: ./src
outPath: ./out
ignore: |
# Exclude test fixtures and editor artifacts.
testdata/
*.tmp
.DS_Store
```

### Common Usage

The most common (though still advanced) usage of this step is to combine content
Expand Down