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

Raise an error if no packages found #327

Open
muzimuzhi opened this issue Nov 21, 2024 · 2 comments
Open

Raise an error if no packages found #327

muzimuzhi opened this issue Nov 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@muzimuzhi
Copy link
Contributor

Recently I made a mistake in renaming the file passed to package-file input: file was renamed to A but package-file accepted another name B (muzimuzhi/tabularray-dev@3ab03da).

Consequently the setup-texlive-action was used with no packages. Due to the existence of cache(s), the job still passed thus my mistake was not uncovered until I checked out the details of job log today.

▼ Run teatimeguest/setup-texlive-action@v3
  with:
    package-file: .github/tl_package
    update-all-packages: true
    cache: true
    tlcontrib: false
Looking for `package-file`...
No file matched the pattern `package-file`
No packages found
▶ Restoring cache
▶ Updating packages
▶ TeX Live environment details

To catch the problem earlier. Maybe the message "No file matched the pattern package-file" can be raised to warning, and "No packages found" be raised to even error.

@teatimeguest
Copy link
Owner

Since the package-file input accepts glob patterns, it is less obvious whether it should be a failure if no match was found, even if there are no special globbing characters. A warning may be acceptable to find potential mistakes, but treating it as an error seems too strict to me.

As a more general approach, it might be possible to have an option like fail-fast to cause the action to fail instead of any warning.

@teatimeguest teatimeguest added the enhancement New feature or request label Nov 22, 2024
@muzimuzhi
Copy link
Contributor Author

A warning may be acceptable to find potential mistakes, but treating it as an error seems too strict to me.

Agreed.

After reconsideration, it's valid use even when both pacakge-file and packages are not specified or match nothing, so the suggested warning or error can only be achieved by introduction of new inputs or environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants