diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ac633f6..dfb6726 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,11 +9,11 @@ jobs: main: runs-on: ubuntu-latest outputs: - matches: ${{ steps.for-each.outputs.matches }} + matches: ${{ steps.find-exec.outputs.matches }} steps: - uses: actions/checkout@v4 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '1' uses: ./ with: @@ -21,7 +21,7 @@ jobs: - if: steps.1.outputs.matches != '["fixtures/function-a/","fixtures/function-b/","fixtures/function-c/","fixtures/run-a/","fixtures/run-b/"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '2' uses: ./ with: @@ -31,7 +31,7 @@ jobs: - if: steps.2.outputs.matches != '["fixtures/function-a/","fixtures/function-c/","fixtures/run-a/"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '3' uses: ./ with: @@ -41,7 +41,7 @@ jobs: - if: steps.3.outputs.matches != '["fixtures/run-a/file.txt","fixtures/run-b/file.txt"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '4' uses: ./ with: @@ -50,7 +50,7 @@ jobs: - if: steps.4.outputs.matches != '["dist/"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '5' uses: ./ with: @@ -61,7 +61,7 @@ jobs: - if: steps.5.outputs.matches != '["./","dist/"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '6' uses: ./ with: @@ -71,7 +71,7 @@ jobs: - if: steps.6.outputs.matches != '["fixtures/function-b/","fixtures/run-b/"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '7' uses: ./ with: @@ -82,7 +82,7 @@ jobs: - if: steps.7.outputs.matches != '[]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '8' uses: ./ with: @@ -92,7 +92,7 @@ jobs: - if: steps.8.outputs.matches != '["banana/a.txt","banana/b.txt"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '9' uses: ./ with: @@ -102,7 +102,7 @@ jobs: - if: steps.9.outputs.matches != '["banana/a.txt","apple/a.txt"]' run: exit 1 - - name: Run colpal/actions-for-each + - name: Run colpal/actions-find-exec id: '10' uses: ./ with: @@ -115,8 +115,8 @@ jobs: - if: steps.10.outputs.matches != '["banana/"]' run: exit 1 - - name: Run colpal/actions-for-each - id: for-each + - name: Run colpal/actions-find-exec + id: find-exec uses: ./ with: patterns: 'fixtures/run-*' diff --git a/README.md b/README.md index 97f0c8c..37c656d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# For Each +# Find Exec Glob the filesystem to create `matrix` definitions for parallel jobs. This action uses [globby](https://github.com/sindresorhus/globby) under the hood @@ -18,13 +18,13 @@ steps: # │   └── file.txt # └── other-folder #    └── file.txt - - id: for-each - uses: colpal/actions-for-each@v0.1 + - id: find-exec + uses: colpal/actions-find-exec@v0.1 with: patterns: | **/file.txt !other-folder/* - - run: echo ${{ steps.for-each.outputs.matches }} + - run: echo ${{ steps.find-exec.outputs.matches }} # ["function-a/file.txt","function-b/file.txt"] ``` @@ -46,13 +46,13 @@ jobs: # └── other-folder #    ├── main.js #    └── deploy.sh - - id: for-each - uses: colpal/actions-for-each@v0.1 + - id: find-exec + uses: colpal/actions-find-exec@v0.1 with: patterns: 'function-*' outputs: # ["function-a/", "function-b/"] - matches: ${{ steps.for-each.outputs.matches }} + matches: ${{ steps.find-exec.outputs.matches }} conquer: needs: divide @@ -72,8 +72,8 @@ For more details on the supported patterns, see ```yaml steps: - - id: for-each - uses: colpal/actions-for-each@v0.1 + - id: find-exec + uses: colpal/actions-find-exec@v0.1 with: # REQUIRED (if `root-patterns` is not specified) # The pattern(s) to be used to find folders/files. More than one pattern @@ -113,7 +113,7 @@ steps: 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 }} + matches: ${{ steps.find-exec.outputs.matches }} ``` ## Recipes @@ -121,7 +121,7 @@ outputs: ### Find all folders that contain certain files ```yaml -- uses: colpal/actions-for-each@v0.1 +- uses: colpal/actions-find-exec@v0.1 with: root-patterns: | ./ @@ -151,15 +151,15 @@ jobs: divide: steps: - uses: actions/checkout@v4 - - id: for-each - uses: colpal/actions-for-each@v0.1 + - id: find-exec + uses: colpal/actions-find-exec@v0.1 with: root-patterns: | containers/*/ filter-patterns: | containers/*/** outputs: - matches: ${{ steps.for-each.outputs.matches }} + matches: ${{ steps.find-exec.outputs.matches }} conquer: needs: divide @@ -198,8 +198,8 @@ jobs: fetch-depth: 0 - id: changed uses: colpal/actions-changed-files@v3 - - id: for-each - uses: colpal/actions-for-each@v0.1 + - id: find-exec + uses: colpal/actions-find-exec@v0.1 with: root-patterns: | containers/*/ @@ -207,7 +207,7 @@ jobs: containers/*/** source: ${{ toJSON(fromJSON(steps.changed.outputs.json).all) }} outputs: - matches: ${{ steps.for-each.outputs.matches }} + matches: ${{ steps.find-exec.outputs.matches }} conquer: needs: divide diff --git a/action.yaml b/action.yaml index c5f6a4e..516b3e3 100644 --- a/action.yaml +++ b/action.yaml @@ -1,4 +1,4 @@ -name: For Each +name: Find Exec description: Create "matrix" compliant file/folder lists using patterns inputs: patterns: diff --git a/package-lock.json b/package-lock.json index da44807..e9d1e10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "actions-for-each", + "name": "actions-find-exec", "version": "0.1.2", "lockfileVersion": 3, "requires": true,