Giter Site home page Giter Site logo

file-type-finder's Introduction

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'

file-type-finder's People

Contributors

ab185508 avatar

Stargazers

André avatar

Watchers

 avatar

file-type-finder's Issues

The `set-output` command is deprecated and will be disabled soon.

Hi,
when I'm running the action, I'm getting this:

Warning: The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

and then people ask me 'What about that warning ...'

Are there any chances for updating the action before the set-output command is disabled?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.