softprops / action-gh-release

📦 :octocat: GitHub Action for creating GitHub Releases
MIT License
3.85k stars 434 forks source link

File Pattern Negation #452

Open Supermarcel10 opened 2 months ago

Supermarcel10 commented 2 months ago

I haven't been able to find any documentation if there exists a way to negate elements in the files section of the workflow.

The idea being is that you can bulk select an entire selection of files for the workflow, but deselect specific selections (similar to how .gitignore works). Or alternatively a way to use regex where I can say that I want all jar files without a specific string.

Usage:

files: |
            build/libs/*.jar
            !build/libs/*-unshaded.jar

Thrown warning: 🤔 Pattern '!build/libs/*-unshaded.jar' does not match any files.

What I want to achieve with this, is add all built jar files from my modules, without their -unshaded versions.

caquino commented 3 weeks ago

The way that the patterns work is a little bit different, for example to skip unshaded you would use

files: |
        build/libs/*!(*unshaded*).jar

I didn't test this, so you may need to play around with the *. Also, you don't need two patterns; just one will attach all jars that don't have unshaded.