Given a set of file paths, outputs the set of directories containing those files.
Required A JSON array of file paths.
A JSON array of directories containing the files.
jobs:
sample:
runs-on: ubuntu-latest
steps:
- uses: sebelino/action-dirname@v1.0.5
id: dirname
with:
files: '["main.tf", "versions.tf", "modules/vpc/sg.tf"]'
- run: |
# Will output: [".","modules/vpc"]
echo ${{ toJson(steps.dirname.outputs.directories) }}
$ go run ./app.go '["main.tf", "versions.tf", "modules/vpc/sg.tf"]'
[".","modules/vpc"]