Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

File List

v0.2

File List

play

File List

lists all config files

Installation

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

              

- name: File List

uses: martinhaintz/[email protected]

Learn more about this action in martinhaintz/ga-file-list

Choose a version

Lists all Files (in optional Subdirectory)

javscript-action status

This small and simple plugin lists all files of a directory and returns the output as json. This json can be later used for a dynamic build matrix.

Inputs

directory

Optional The directory to look for the files. Default "project root".

file_extension

Optional File extension filter. (e.g., "txt","yml")

ignore_files_starts_with

Optional List of values for which files should be ignored. (e.g., "ignore_,test,config-")

ignore_files_starts_with_delimiter

Optional Delimiter for the list. (Default: ",")

Outputs

files

The list of files including file extension as json

file_names

The list of files names without file extension as json

Usage

uses: the-coding-turtle/[email protected]

Or with optional parameters:

uses: the-coding-turtle/[email protected]
with:
  directory: "configs"
  file_extension: "yml"
  ignore_files_starts_with: "ignore_;test;config-"
  ignore_files_starts_with_delimiter: ";"

Matrix Build / Multi-Tenancy for Google AppEngine (My use case)

name: Multi Tenant GAE Deploy

on:
  push:
  workflow_dispatch:

jobs:
  lookup:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.filelist.outputs.file_names }}
    steps:
    - uses: actions/checkout@v2
    - name: Get all yaml files
      id: filelist
      uses: the-coding-turtle/[email protected]
      with:
        directory: "gae_yaml"
        file_extension: "yaml"

  multi_tenant:
    needs: lookup
    runs-on: ubuntu-latest
    strategy:
      matrix:
        tenant: ${{fromJson(needs.lookup.outputs.matrix)}}
    steps:
    - uses: actions/checkout@v2
    - name: Show all tenants
      run: |
        echo "this is tenant: ${{ matrix.TENANT }}"