From cf997b751a390303fab8497f68ab4f5ad9670e73 Mon Sep 17 00:00:00 2001 From: Robin LIORET Date: Thu, 13 Aug 2026 12:04:27 +0200 Subject: [PATCH 1/2] docs: update copy promotion step behaviour and configuration Signed-off-by: Robin Lioret --- .../30-promotion-steps/copy.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md b/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md index ca7ab9a1c2..18510e5698 100644 --- a/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md +++ b/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md @@ -14,9 +14,48 @@ 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, and `.git` directories are +always ignored, regardless of the `ignore` patterns. +::: ## 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 From 61e86d7b68cafb804d0696df9346357db21e7ca2 Mon Sep 17 00:00:00 2001 From: Robin Lioret Date: Mon, 17 Aug 2026 15:58:47 +0200 Subject: [PATCH 2/2] docs: correct `.git` ignore behaviour for the copy step The default `.git` pattern is prepended before user-supplied `ignore` rules, and go-git's matcher gives the last matching pattern precedence. A negation such as `!.git/` therefore re-includes the directory, so the exclusion is a default rather than unconditional. Co-Authored-By: Claude Opus 5 Signed-off-by: Robin Lioret --- .../60-reference-docs/30-promotion-steps/copy.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md b/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md index 18510e5698..26e0e17a13 100644 --- a/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md +++ b/docs/docs/50-user-guide/60-reference-docs/30-promotion-steps/copy.md @@ -21,8 +21,10 @@ its contents are merged with those of the source. Existing destination files are overwritten. :::note -Symlinks encountered in the source are skipped, and `.git` directories are -always ignored, regardless of the `ignore` patterns. +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. ::: ## Examples