teatimeguest / setup-texlive-action

A GitHub Action to set up TeX Live
https://github.com/marketplace/actions/setup-texlive-action
MIT License
41 stars 2 forks source link

Raise an error if no packages found #327

Open muzimuzhi opened 1 week ago

muzimuzhi commented 1 week ago

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 (https://github.com/muzimuzhi/tabularray-dev/commit/3ab03daf78caff08ac5435e7b2e12356fb6d46c0).

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 commented 1 week ago

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.

muzimuzhi commented 1 week ago

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.