Repository: cdklabs/cdk-pipelines-github (ts)

Issue:
Breaking Change in GitHub actions/upload-artifact@v4
In GitHub's https://github.com/actions/upload-artifact/pull/598, they disabled the inclusion of dot files/hidden files by default without releasing a major version change.

As a result, the `cdk.out` uploaded by CDK Pipelines for GitHub Workflows now omit dot files. The missing dot files have begun breaking several of my pipelines that rely on `DockerImageFunction`s that reference dotfiles like `.yarnrc.yml` while building a container image asset because required files are missing from the staged assets.

We need the upload-artifact action input to include `include-hidden-files: true` so the hidden files we require are included. https://github.com/cdklabs/cdk-pipelines-github/blob/fa8d504166e3cf9d792b0a69708b395879467c54/src/pipeline.ts#L792-L796 

References:
- Issue: https://github.com/actions/upload-artifact/issues/602
- Their PR: https://github.com/actions/upload-artifact/pull/598

Pull request:
fix: upload-artifact v4 breaking change 
fixes #1103 

Patch:
diff --git a/src/pipeline.ts b/src/pipeline.ts
index 1bee61b..856f1d8 100644
--- a/src/pipeline.ts
+++ b/src/pipeline.ts
@@ -920,6 +920,7 @@ export class GitHubWorkflow extends PipelineBase {
       with: {
         name: CDKOUT_ARTIFACT,
         path: dir,
+        ['include-hidden-files']: true,
       },
     }];
   }


Test patch:
diff --git a/test/__snapshots__/github.cn.test.ts.snap b/test/__snapshots__/github.cn.test.ts.snap
index bffe34d..8a1ba6d 100644
--- a/test/__snapshots__/github.cn.test.ts.snap
+++ b/test/__snapshots__/github.cn.test.ts.snap
@@ -403,6 +403,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -524,6 +525,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -557,6 +559,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     if: github.repository == 'account/repo'
@@ -681,6 +684,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -808,6 +812,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -840,6 +845,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -964,6 +970,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -996,6 +1003,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
diff --git a/test/__snapshots__/github.test.ts.snap b/test/__snapshots__/github.test.ts.snap
index 31614ad..373c453 100644
--- a/test/__snapshots__/github.test.ts.snap
+++ b/test/__snapshots__/github.test.ts.snap
@@ -403,6 +403,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -524,6 +525,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -556,6 +558,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -688,6 +691,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -820,6 +824,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -956,6 +961,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -989,6 +995,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     if: github.repository == 'account/repo'
@@ -1113,6 +1120,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -1240,6 +1248,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -1272,6 +1281,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -1396,6 +1406,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
 "
 `;
 
@@ -1428,6 +1439,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
diff --git a/test/__snapshots__/runner-provided.cn.test.ts.snap b/test/__snapshots__/runner-provided.cn.test.ts.snap
index 473977d..ebf909f 100644
--- a/test/__snapshots__/runner-provided.cn.test.ts.snap
+++ b/test/__snapshots__/runner-provided.cn.test.ts.snap
@@ -31,6 +31,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
diff --git a/test/__snapshots__/runner-provided.test.ts.snap b/test/__snapshots__/runner-provided.test.ts.snap
index 86a0620..60bc94e 100644
--- a/test/__snapshots__/runner-provided.test.ts.snap
+++ b/test/__snapshots__/runner-provided.test.ts.snap
@@ -31,6 +31,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
diff --git a/test/__snapshots__/stage-options.cn.test.ts.snap b/test/__snapshots__/stage-options.cn.test.ts.snap
index 2c4b63d..fb5adad 100644
--- a/test/__snapshots__/stage-options.cn.test.ts.snap
+++ b/test/__snapshots__/stage-options.cn.test.ts.snap
@@ -32,6 +32,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     if: contains(fromJson('[\\"push\\", \\"pull_request\\"]'), github.event_name)
@@ -160,6 +161,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -252,6 +254,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -344,6 +347,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -468,6 +472,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     if: contains(github.event.issue.labels.*.name, 'deployToA') ||
@@ -629,6 +634,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -721,6 +727,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -842,6 +849,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
diff --git a/test/__snapshots__/stage-options.test.ts.snap b/test/__snapshots__/stage-options.test.ts.snap
index b2a2ede..223f622 100644
--- a/test/__snapshots__/stage-options.test.ts.snap
+++ b/test/__snapshots__/stage-options.test.ts.snap
@@ -32,6 +32,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     if: contains(fromJson('[\\"push\\", \\"pull_request\\"]'), github.event_name)
@@ -160,6 +161,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -252,6 +254,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -344,6 +347,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -468,6 +472,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     if: contains(github.event.issue.labels.*.name, 'deployToA') ||
@@ -629,6 +634,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -721,6 +727,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs:
@@ -842,6 +849,7 @@ jobs:
         with:
           name: cdk.out
           path: cdk.out
+          include-hidden-files: true
   Assets-FileAsset1:
     name: Publish Assets Assets-FileAsset1
     needs: