Skip to content
file

GitHub Action

List Files Action

v3.0.5 Latest version

List Files Action

file

List Files Action

List all matching files in specific path

Installation

Copy and paste the following snippet into your .yml file.

              

- name: List Files Action

uses: mirko-felice/[email protected]

Learn more about this action in mirko-felice/list-files-action

Choose a version

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