Sebelino / action-dirname

Given a set of file paths, outputs the set of directories containing those files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

action-dirname

Given a set of file paths, outputs the set of directories containing those files.

Inputs

files

Required A JSON array of file paths.

Outputs

directories

A JSON array of directories containing the files.

Example usage

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) }}

Development

$ go run ./app.go '["main.tf", "versions.tf", "modules/vpc/sg.tf"]'
[".","modules/vpc"]

About

Given a set of file paths, outputs the set of directories containing those files.

License:MIT License


Languages

Language:Go 73.3%Language:Dockerfile 26.7%