Skip to content

GitHub action to list path of all files of a particular extension in the folder/directory specified by the user.

License

Notifications You must be signed in to change notification settings

mirko-felice/list-files-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

List Files Action

GitHub release (latest SemVer)

Test

Quality Gate Status

GitHub action to list path of all files of a particular extension in the folder/directory specified by the user.

Inputs

Input Description
repo (required) Repository name where to search files
ref (optional => default is 'master') Branch or tag to checkout
path (required) Path where searching files
ext (required) File extension to match

Outputs

Output Description
paths Paths of all the files with the extension

Usage example

name: Test

on:
  push:
    tags-ignore:
      - '*'
    branches:
      - 'master'
  pull_request:
  workflow_dispatch:

jobs:
  list-files:
    runs-on: ubuntu-latest
    outputs:
      paths: ${{ steps.list-files.outputs.paths }}
    steps:
      - name: List Files
        id: list-files
        uses: mirko-felice/[email protected]
        with:
          repo: ${{ github.repository }}
          ref: ${{ github.ref }}
          path: "."
          ext: ".yml"
  Test:
    needs: list-files
    strategy:
      matrix:
        paths: ${{ fromJson(needs.list-files.outputs.paths) }}
    runs-on: ubuntu-latest
    steps:
      - name: Output results
        run: |
          echo ${{ matrix.paths }}

Output generated for the above yaml file (in this repository):

github/workflows/test.yml
action.yml

License

MIT license

About

GitHub action to list path of all files of a particular extension in the folder/directory specified by the user.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages