Skip to content

Commit

Permalink
Update evaluate-expressions-in-workflows-and-actions.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-mxwl committed Feb 10, 2025
1 parent 62f9914 commit 71dea08
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,30 @@ Returns a single hash for the set of files that matches the `path` pattern. You

You can use pattern matching characters to match file names. Pattern matching for `hashFiles` follows glob pattern matching and is case-insensitive on Windows. For more information about supported pattern matching characters, see the [Patterns](https://www.npmjs.com/package/@actions/glob#patterns) section in the `@actions/glob` documentation.

#### Example with a single pattern
#### Examples with a single pattern

Matches any `package-lock.json` file in the repository.

`hashFiles('**/package-lock.json')`

#### Example with multiple patterns
Matches all `.js` files in the `src` directory at root level, but ignores any subdirectories of `src`.

`hashFiles('/src/*.js')`

Matches all `.rb` files in the `lib` directory at root level, including any subdirectories of `lib`.

`hashFiles('/lib/**/*.rb')`

#### Examples with multiple patterns

Creates a hash for any `package-lock.json` and `Gemfile.lock` files in the repository.

`hashFiles('**/package-lock.json', '**/Gemfile.lock')`

Creates a hash for all `.rb` files in the `lib` directory at root level, including any subdirectories of `lib`, but excluding `.rb` files in the `foo` subdirectory.

`hashFiles('/lib/**/*.rb', '!/lib/foo/*.rb')`

## Status check functions

You can use the following status check functions as expressions in `if` conditionals. A default status check of `success()` is applied unless you include one of these functions. For more information about `if` conditionals, see [AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif) and [AUTOTITLE](/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif).
Expand Down

0 comments on commit 71dea08

Please sign in to comment.