Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Split Path – JavaScript action

Takes a path and splits it at the last slash character, if any.

Inputs

path

Required The path to split.

Outputs

dirname

If there are any slashes in path, everything before the last slash; otherwise, the string '.'.

basename

If there are any slashes in path, everything after the last slash; otherwise, all of path.

Example usage

In this example we split the value of a variable provided by GitHub actions to obtain the plain name of the repo and the name of its owner (user or organization):

  - id: split-repo
    uses: action-util/split-path@v1
    with:
      path: ${{ github.repository }}

Now ${{ steps.split-repo.outputs.basename }} is the name of the repository, and ${{ steps.split-repo.outputs.dirname }} is the name of its owner.

About

JavaScript GH Action to split a path into dirname and basename

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages