Skip to content

Commit

Permalink
make pattern error opt in (#417)
Browse files Browse the repository at this point in the history
* make pattern error opt in

* changelog link
  • Loading branch information
softprops committed Mar 10, 2024
1 parent 20e085c commit 0e39c67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
## 2.0.2 (unreleased)

- Revisit approach to [#384](https://github.com/softprops/action-gh-release/pull/384) making unresolved pattern failures opt-in [#417](https://github.com/softprops/action-gh-release/pull/417)

## 2.0.1

- Add support for make_latest property [#304](https://github.com/softprops/action-gh-release/pull/304) via [@samueljseay](https://github.com/samueljseay)
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Expand Up @@ -25,7 +25,11 @@ async function run() {
if (config.input_files) {
const patterns = unmatchedPatterns(config.input_files);
patterns.forEach((pattern) => {
throw new Error(`鈿狅笍 Pattern '${pattern}' does not match any files.`);
if (config.input_fail_on_unmatched_files) {
throw new Error(`鈿狅笍 Pattern '${pattern}' does not match any files.`);
} else {
console.warn(`馃 Pattern '${pattern}' does not match any files.`);
}
});
if (patterns.length > 0 && config.input_fail_on_unmatched_files) {
throw new Error(`鈿狅笍 There were unmatched files`);
Expand Down

0 comments on commit 0e39c67

Please sign in to comment.