Skip to content

Commit 91ac1d2

Browse files
authored
Update evaluate-expressions-in-workflows-and-actions.md (#36232)
1 parent 9c04d81 commit 91ac1d2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Diff for: content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -292,18 +292,30 @@ Returns a single hash for the set of files that matches the `path` pattern. You
292292

293293
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.
294294

295-
#### Example with a single pattern
295+
#### Examples with a single pattern
296296

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

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

301-
#### Example with multiple patterns
301+
Matches all `.js` files in the `src` directory at root level, but ignores any subdirectories of `src`.
302+
303+
`hashFiles('/src/*.js')`
304+
305+
Matches all `.rb` files in the `lib` directory at root level, including any subdirectories of `lib`.
306+
307+
`hashFiles('/lib/**/*.rb')`
308+
309+
#### Examples with multiple patterns
302310

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

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

315+
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.
316+
317+
`hashFiles('/lib/**/*.rb', '!/lib/foo/*.rb')`
318+
307319
## Status check functions
308320

309321
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).

0 commit comments

Comments
 (0)