Skip to content
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

Use explicit filename source in config file artifact upload step of "Sync Labels" workflows #528

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Nov 4, 2024

Starting from version 3.2.0 of the actions/upload-artifact action, "hidden" files are not uploaded by default (actions/upload-artifact#602). The action considers a file "hidden" if any component of the path starts with ..

The download job of the "Sync Labels" workflow downloads each of the shared label configuration files from and uploads them to GitHub Actions workflow artifacts for use by the subsequent job. Since the names of the configuration files don't start with . and they aren't located in a subfolder that starts with ., we would not expect that this job could be impacted by the new hidden file handling behavior. However, it was impacted after all under certain conditions. Previously, wildcard patterns were used in the path input of the job's actions/upload-artifact action step. It turns out that in the case of wildcards, the entire absolute path to the file is considered in the determination of whether it is "hidden". The "workspace" in which the workflow's steps are performed is under a path that includes the repository name. So if the repository name starts with a . (e.g., .github, then the actions/upload-artifact action step failed spuriously:

Run actions/upload-artifact@v3
Error: No files were found with the provided path: *.yaml
*.yml. No artifacts will be uploaded.

Although this could be fixed by setting the actions/upload-artifact action's include-hidden-files input to true, it actually doesn't make sense to use a wildcard in the path input when the name of the single file is already available (the wildcard approach is a vestigial remnant of a previous version of the workflow that downloaded all configuration files in a single job, before it was changed to using a job matrix). By changing the path input value to the file's explicit relative path, it is ensured that the file will never be treated as "hidden", regardless of the repository name.

…Sync Labels" workflows

Starting from version 3.2.0 of the "actions/upload-artifact" action, "hidden" files are not uploaded by default. The
action considers a file "hidden" if any component of the path starts with `.`.

The "download" job of the "Sync Labels" workflow downloads each of the shared label configuration files from and uploads
them to GitHub Actions workflow artifacts for use by the subsequent job. Since the names of the configuration files
don't start with `.` and they aren't located in a subfolder that starts with `.`, we would not expect that this job
could be impacted by the new hidden file handling behavior. However, it was impacted after all, under certain
conditions. Previously, wildcard patterns were used in the `path` input of the job's "actions/upload-artifact" action
step. It turns out that in the case of wildcards, the entire absolute path to the file is considered in the
determination of whether it is "hidden". The "workspace" in which the workflow's steps are performed is under a path
that includes the repository name. So if the repository name starts with a `.` (e.g., `.github`), then the
"actions/upload-artifact" action step failed spuriously:

```
Run actions/upload-artifact@v3
Error: No files were found with the provided path: *.yaml
*.yml. No artifacts will be uploaded.
```

Although this could be fixed by setting the "actions/upload-artifact" action's `include-hidden-files` input to `true`,
it actually doesn't make sense to use a wildcard in the `path` input when the name of the single file is already
available (the wildcard approach is a vestigial remnant of a previous version of the workflow that downloaded all
configuration files in a single job, before it was changed to using a job matrix). By changing the `path` input value to
the file's explicit relative path, it is ensured that the file will never be treated as "hidden", regardless of the
repository name.
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Nov 4, 2024
@per1234 per1234 self-assigned this Nov 4, 2024
@per1234 per1234 merged commit f5c8353 into arduino:main Nov 4, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant