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

GitHub Action

Glob match

v8

Glob match

filter

Glob match

Search for files matching glob patterns

Installation

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

              

- name: Glob match

uses: tj-actions/glob@v8

Learn more about this action in tj-actions/glob

Choose a version

Codacy Badge Codacy Badge build-test Update release version. Public workflows that use this action.

Ubuntu Mac OS Windows

glob

Search for files matching glob patterns with support for returning matching deleted git tracked files

...
    steps:
      - uses: actions/checkout@v2

      - name: Glob match
        uses: tj-actions/[email protected]
        id: glob
        with:
          files: |
            *.md
            **.yaml
            **.yml
            !action.yml
            **/rebase.yml

      - name: Show all matching files
        run: |
          echo "${{ steps.glob.outputs.paths }}"
        # Outputs: .github/workflows/rebase.yml .github/workflows/sync-release-version.yml .github/workflows/test.yml...

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
base-sha string false Specify a base commit SHA
used for comparing changes, when
include-deleted-files is set to true
escape-paths string false "false" Escape special characters of filenames
used in the paths output
excluded-files string false Excluded file patterns (optionally include
! before the file pattern
or it would be prepended)
excluded-files-from-source-file string false Source file to populate the
excluded-files input
excluded-files-from-source-file-separator string false "\n" Separator used to split the
excluded-files-from-source-file input
excluded-files-separator string false "\n" Separator used to split the
excluded-files input
files string false File patterns
files-from-source-file string false Source file to populate the
files input
files-from-source-file-separator string false "\n" Separator used to split the
files-from-source-file input
files-separator string false "\n" Separator used to split the
files input
follow-symbolic-links string true "true" Indicates whether to follow symbolic
links
include-deleted-files string false "false" Include all matching deleted files
separator string true " " Separator used for the paths
output.
sha string true "${{ github.sha }}" Specify a current commit SHA
used for comparing changes, when
include-deleted-files is set to true
strip-top-level-dir string false "true" Strip the $GITHUB_WORKSPACE from the
paths output
working-directory string false "${{ github.workspace }}" Specify a relative path under
$GITHUB_WORKSPACE to locate the repository

Outputs

OUTPUT TYPE DESCRIPTION
paths string List of filtered paths using
the specified patterns and separator
paths-output-file string List of filtered paths using
the specified patterns and separator
stored in a tempfile

If you feel generous and want to show some extra appreciation:

Buy me a coffee

Credits

This package was created with Cookiecutter using cookiecutter-action

Report Bugs

Report bugs at https://github.com/tj-actions/glob/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.