mirror of
https://github.com/actions/cache.git
synced 2026-05-13 21:38:06 +00:00
Merge 9b5580e861 into 27d5ce7f10
This commit is contained in:
commit
639718319a
@ -179,6 +179,8 @@ jobs:
|
|||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
> You must use the `cache` or `restore` action in your workflow before you need to use the files that might be restored from the cache. If the provided `key` matches an existing cache, a new cache is not created and if the provided `key` doesn't match an existing cache, a new cache is automatically created provided the job completes successfully.
|
> You must use the `cache` or `restore` action in your workflow before you need to use the files that might be restored from the cache. If the provided `key` matches an existing cache, a new cache is not created and if the provided `key` doesn't match an existing cache, a new cache is automatically created provided the job completes successfully.
|
||||||
|
>
|
||||||
|
> **`pull_request_target` exception:** When `actions/cache` is used in a `pull_request_target` workflow, the automatic post-step save is **skipped**. This is a security measure to prevent untrusted pull request code from poisoning caches accessible to privileged workflows. If really you need to save a cache in a trusted `pull_request_target` context (e.g., after validating the PR source), use [`actions/cache/save`](./save/README.md) explicitly with an appropriate `if` condition.
|
||||||
|
|
||||||
## Caching Strategies
|
## Caching Strategies
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ runs:
|
|||||||
using: 'node24'
|
using: 'node24'
|
||||||
main: 'dist/restore/index.js'
|
main: 'dist/restore/index.js'
|
||||||
post: 'dist/save/index.js'
|
post: 'dist/save/index.js'
|
||||||
post-if: "success()"
|
post-if: "success() && github.event_name != 'pull_request_target'"
|
||||||
branding:
|
branding:
|
||||||
icon: 'archive'
|
icon: 'archive'
|
||||||
color: 'gray-dark'
|
color: 'gray-dark'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user