From f21e280b5c8b233297bd26564cd4a70995c8e593 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 26 May 2021 06:04:24 -0400 Subject: [PATCH] Update 0279-hashFiles-expression-function.md (#1107) --- docs/adrs/0279-hashFiles-expression-function.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/adrs/0279-hashFiles-expression-function.md b/docs/adrs/0279-hashFiles-expression-function.md index c52380f8f6f..1de07a82747 100644 --- a/docs/adrs/0279-hashFiles-expression-function.md +++ b/docs/adrs/0279-hashFiles-expression-function.md @@ -5,7 +5,7 @@ **Status**: Accepted ## Context -First party action `actions/cache` needs a input which is an explicit `key` used for restoring and saving the cache. For packages caching, the most comment `key` might be the hash result of contents from all `package-lock.json` under `node_modules` folder. +First party action `actions/cache` needs a input which is an explicit `key` used for restoring and saving the cache. For packages caching, the most common `key` might be the hash result of contents from all `package-lock.json` under `node_modules` folder. There are serval different ways to get the hash `key` input for `actions/cache` action. @@ -38,7 +38,7 @@ There are serval different ways to get the hash `key` input for `actions/cache` `hashFiles()` will only support hashing files under the `$GITHUB_WORKSPACE` since the expression evaluated on the runner, if customer use job container or container action, the runner won't have access to file system inside the container. `hashFiles()` will only take 1 parameters: - - `hashFiles('**/package-lock.json')` // Search files under $GITHUB_WORKSPACE and calculate a hash for them + - `hashFiles('**/package-lock.json')` // Search files under `$GITHUB_WORKSPACE` and calculate a hash for them **Question: Do we need to support more than one match patterns?** Ex: `hashFiles('**/package-lock.json', '!toolkit/core/package-lock.json', '!toolkit/io/package-lock.json')` @@ -52,7 +52,7 @@ This will help customer has better experience with the `actions/cache` action's key: ${{hashFiles('**/package-lock.json')}}-${{github.ref}}-${{runner.os}} ``` -For search pattern, we will use basic globbing (`*` `?` and `[]`) and globstar (`**`). +For search pattern, we will use basic globbing (`*`, `?`, and `[]`) and globstar (`**`). Additional pattern details: - Root relative paths with `github.workspace` (the main repo) @@ -68,4 +68,4 @@ Hashing logic: 5. Use SHA256 to hash all stored files' hash results to get the final 64 chars hash result. **Question: Should we include the folder structure info into the hash?** -Answer: No \ No newline at end of file +Answer: No