Skip to content

[skip changelog] Configure actions/upload-artifact action to upload required hidden files #2699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2024
Merged
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
[skip changelog] Configure actions/upload-artifact action to upload r…
…equired 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.

This project's "Check Go Dependencies" workflow uses 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 workflow uploads 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 in addition to not uploading the artifact, the change in the "actions/upload-artifact" action's behavior also
resulted in the workflow runs failing:

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 workflow can once more upload the dependencies license metadata cache to a workflow
artifact as needed.
  • Loading branch information
per1234 committed Sep 3, 2024
commit eb000d351dd670a63d4d7ba5bc3f279dc82834c6
1 change: 1 addition & 0 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
include-hidden-files: true
name: dep-licenses-cache
path: .licenses/

Expand Down
Loading