From 40e8d9c93a67982a66e141cb69a16d3d05e7b2c5 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 3 Sep 2024 11:21:27 -0700 Subject: [PATCH] Configure actions/upload-artifact action to upload required hidden files A breaking change was made in the 3.2.1 release of the "actions/upload-artifact" action, without doing a major version bump as would be done in a responsibly maintained project. The action now defaults to not uploading "hidden" files. The "Check Go Dependencies" and "Check npm Dependencies" templates use the "Licensed" tool to check for incompatible dependency licenses. The dependencies license metadata cache used by Licensed is stored in a folder named `.licensed`. In order to facilitate updates, the workflows of these templates upload the generated dependencies license metadata cache as a workflow artifact when the current cache is found to be outdated. The `.` at the start of the `.licensed` folder name causes it to now not be uploaded to the workflow artifact. In order to catch such problems, the workflow configures the "actions/upload-artifact" action to fail if no files were uploaded. So the workflow now fails: Error: No files were found with the provided path: .licenses/. No artifacts will be uploaded. The problem is fixed by disabling the "actions/upload-artifact" action's new behavior via the `include-hidden-files` input. After this change, the workflows can once more upload the dependencies license metadata cache to a workflow artifact as needed --- workflow-templates/check-go-dependencies-task.yml | 1 + workflow-templates/check-npm-dependencies-task.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/workflow-templates/check-go-dependencies-task.yml b/workflow-templates/check-go-dependencies-task.yml index 3daf9c42..0560ef76 100644 --- a/workflow-templates/check-go-dependencies-task.yml +++ b/workflow-templates/check-go-dependencies-task.yml @@ -114,6 +114,7 @@ jobs: uses: actions/upload-artifact@v4 with: if-no-files-found: error + include-hidden-files: true name: dep-licenses-cache path: .licenses/ diff --git a/workflow-templates/check-npm-dependencies-task.yml b/workflow-templates/check-npm-dependencies-task.yml index 07b7def6..572af0e8 100644 --- a/workflow-templates/check-npm-dependencies-task.yml +++ b/workflow-templates/check-npm-dependencies-task.yml @@ -114,6 +114,7 @@ jobs: uses: actions/upload-artifact@v3 with: if-no-files-found: error + include-hidden-files: true name: dep-licenses-cache path: .licenses/