GitHub.Actions.Glob 8.0.13

dotnet add package GitHub.Actions.Glob --version 8.0.13
NuGet\Install-Package GitHub.Actions.Glob -Version 8.0.13
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GitHub.Actions.Glob" Version="8.0.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GitHub.Actions.Glob --version 8.0.13
#r "nuget: GitHub.Actions.Glob, 8.0.13"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GitHub.Actions.Glob as a Cake Addin
#addin nuget:?package=GitHub.Actions.Glob&version=8.0.13

// Install GitHub.Actions.Glob as a Cake Tool
#tool nuget:?package=GitHub.Actions.Glob&version=8.0.13

GitHub.Actions.Glob package

To install the GitHub.Actions.Glob NuGet package:

<PackageReference Include="GitHub.Actions.Glob" Version="[Version]" />

Or use the dotnet add package .NET CLI command:

dotnet add package GitHub.Actions.Glob

Get the IGlobPatternResolverBuilder instance

To use the IGlobPatternResolverBuilder in your .NET project, register the services with an IServiceCollection instance by calling AddGitHubActionsGlob and then your consuming code can require the IGlobPatternResolverBuilder via constructor dependency injection.

using Microsoft.Extensions.DependencyInjection;
using Actions.Glob;
using Actions.Glob.Extensions;

using var provider = new ServiceCollection()
    .AddGitHubActionsGlob()
    .BuildServiceProvider();

var glob = provider.GetRequiredService<IGlobPatternResolverBuilder>();

GitHub.Actions.Glob

This was modified, but borrowed from the glob/README.md.

You can use this package to search for files matching glob patterns.

Basic usage

Relative paths and absolute paths are both allowed. Relative paths are rooted against the current working directory.

using Actions.Glob;
using Actions.Glob.Extensions;

var patterns = new[] { "**/tar.gz", "**/tar.bz" };
var globber = Globber.Create(patterns);
var files = globber.GlobFiles();

Get all files recursively

using Actions.Glob;
using Actions.Glob.Extensions;

var globber = Globber.Create("**/*");
var files = globber.GlobFiles();

Iterating files

When dealing with a large amount of results, consider iterating the results as they are returned:

using Actions.Glob;
using Actions.Glob.Extensions;

var globber = Globber.Create("**/*");
foreach (var file in globber.GlobFiles())
{
    // Do something with the file
}

When an action allows a user to specify input patterns, it is generally recommended to allow users to opt-out from following symbolic links.

Snippet from action.yml:

inputs:
  files:
    description: "Files to print"
    required: true

And corresponding toolkit consumption:

using Microsoft.Extensions.DependencyInjection;
using Actions.Core;
using Actions.Core.Extensions;
using Actions.Glob;
using Actions.Glob.Extensions;

using var provider = new ServiceCollection()
    .AddGitHubActionsCore()
    .BuildServiceProvider();

var core = provider.GetRequiredService<ICoreService>();

var globber = Globber.Create(core.GetInput("files"))
foreach (var file in globber.GlobFiles())
{
    // Do something with the file
}

Pattern formats

The patterns that are specified in the AddExclude and AddInclude methods can use the following formats to match multiple files or directories.

  • Exact directory or file name

    • some-file.txt
    • path/to/file.txt
  • Wildcards * in file and directory names that represent zero to many characters not including separator characters.

    Value Description
    *.txt All files with .txt file extension.
    *.* All files with an extension.
    * All files in top-level directory.
    .* File names beginning with '.'.
    *word* All files with 'word' in the filename.
    readme.* All files named 'readme' with any file extension.
    styles/*.css All files with extension '.css' in the directory 'styles/'.
    scripts/*/* All files in 'scripts/' or one level of subdirectory under 'scripts/'.
    images*/* All files in a folder with name that is or begins with 'images'.
  • Arbitrary directory depth (/**/).

    Value Description
    **/* All files in any subdirectory.
    dir/**/* All files in any subdirectory under 'dir/'.
  • Relative paths.

    To match all files in a directory named "shared" at the sibling level to the base directory, use ../shared/*.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.13 92 4/8/2024
8.0.12 97 3/6/2024
8.0.11 132 2/2/2024
8.0.10 73 1/31/2024
8.0.9 74 1/29/2024
8.0.8 79 1/27/2024
8.0.7 76 1/25/2024
8.0.4 75 1/23/2024
8.0.3 181 11/26/2023
8.0.2 86 11/26/2023
8.0.1 94 11/22/2023
8.0.0 107 11/18/2023
8.0.0-rc.1.23419.4 73 9/14/2023
1.0.0 176 12/7/2022