Skip to content

A GitHub action to list paths or file names for files with certain extensions in a repository.

Notifications You must be signed in to change notification settings

ab185508/file-type-finder

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Type Finder

File type finder lists paths and file names for files with certain extensions in a repository. The action allows you to input a path to search in or a csv file. The action is useful when you are trying to find all your files of a certain type or if you want to input files of a certain type to another action.

Usage

See main.yml for a basic usage example. This workflow will run through the entire repo and look for .yml files.

- name: File type finder action
    id: ftf
    uses: ab185508/file-type-finder@main
    with:
        path: "/"
        type: ".yml"

Inputs

path: (Optional) Path to where you want to the search to run. Set to "/" if you want to search the whole repo.

type: (Required) The type of file you want to search for.

fileinput: (Optional) Boolean to indicate if you want to provide a csv file input instead of a path. This value is set to false by default.

file: (Optional) Path or reference to the file you are passing in. See testcase1 to see how this can be applied with a reference to an output from another action.

extchange: (Optional) Boolean to indicate if you want to output to an additional list that has all the file extensions changed to something new. This is added as it provides a useful tool when working with file conversion actions. The value is set to false by default.

ext: (Optional) The extension you want to convert to. See testcase2 for a reference on this.

Outputs

paths: A list of the paths to the files that contain the desired extension.

names: All the names of the files that contain those desired extensions.

extaddpaths: A list of the paths to the files with the desired extension but the extension is converted to the one provided in the ext input.

Example Workflows

Gets modified files using another action and takes in the csv from that as input. Then, it runs through the files and finds the ones that end in .yml.

- name: File type finder action
    id: ftf
    uses: ab185508/file-type-finder@main
    with:
        path: "/"
        type: ".yml"
        fileinput: true
        file: ${{ steps.files.outputs.added_modified }}

Gets modified files using another action and takes in the csv from that as input. Then, it runs through the files to find the ones that end in .drawio. It then takes the extension for all those files and swaps it to .png.

- name: File type finder action
    id: ftf
    uses: ab185508/file-type-finder@main
    with:
        type: ".drawio"
        fileinput: true
        file: ${{ steps.files.outputs.added_modified }}
        extchange: true
        ext: '.png'

About

A GitHub action to list paths or file names for files with certain extensions in a repository.

Resources

Stars

Watchers

Forks

Packages

No packages published