-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from colpal/hoisting
Add support for "hoisting" mode
- Loading branch information
Showing
8 changed files
with
255 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,6 @@ module.exports = { | |
sourceType: 'module', | ||
}, | ||
rules: { | ||
'import/extensions': ['error', 'ignorePackages'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ steps: | |
# ["function-a/file.txt","function-b/file.txt"] | ||
``` | ||
|
||
### Parallel | ||
### Static Parallel | ||
|
||
```yaml | ||
jobs: | ||
|
@@ -75,11 +75,51 @@ steps: | |
- id: for-each | ||
uses: colpal/[email protected] | ||
with: | ||
# REQUIRED | ||
# REQUIRED (if `root-patterns` is not specified) | ||
# The pattern(s) to be used to find folders/files. More than one pattern | ||
# may be supplied by putting each on its own line. | ||
patterns: string | ||
patterns: single-line string | multi-line string | ||
|
||
# OPTIONAL (only valid if `root-patterns` is specified) | ||
# DEFAULT = ** | ||
# The pattern(s) to be used to find files/folders to provide to | ||
# `root-patterns` (see the description of `root-patterns` for more | ||
# details) | ||
filter-patterns: single-line string | multi-line string | ||
|
||
# REQUIRED (if `patterns` is not specified) | ||
# The pattern(s) to be used to "hoist" files/folders matched by | ||
# `filter-patterns`. The process is as follows: | ||
# 1. `filter-patterns` is applied to the filesystem to create a list | ||
# of paths (similar to what `patterns` does when specified alone) | ||
# 2. `root-patterns` is then applied to the paths from the previous | ||
# step. Any paths that match will be added to the `matches` output. | ||
# 3. `dirname` will be applied to all paths from step 2 that DID NOT | ||
# match `root-patterns`, effectively removing the last segment of | ||
# the path. For example: | ||
# `folder-a/subfolder-a/file-a` becomes `folder-a/subfolder-a/` | ||
# `folder-a/subfolder-a/` becomes `folder-a/` | ||
# `folder-a/` becomes `./` | ||
# `./` becomes `./` | ||
# 4. Repeat steps 2 - 4 until the only unmatched paths are "./" | ||
# 5. `matches` is set as an output of the action | ||
root-patterns: single-line string | multi-line string | ||
outputs: | ||
# An JSON-formatted array of paths that matched the pattern(s) | ||
matches: ${{ steps.for-each.outputs.matches }} | ||
``` | ||
## Recipes | ||
### Find all folders that contain certain files | ||
```yaml | ||
- uses: colpal/[email protected] | ||
with: | ||
root-patterns: | | ||
./ | ||
**/ | ||
filter-patterns: | | ||
**/main.sh | ||
**/start.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.