|
16 | 16 |
|
17 | 17 | # Stash GitHub Action |
18 | 18 |
|
19 | | -`Stash` provides a solution for managing large build caches in your workflows, that doesn't require any secrets and can be used in fork PRs. |
20 | | -It's designed as an alternative to `actions/cache` which struggles with big build caches such as `.ccache` directories. |
21 | | -This action is lit into two distinct operations: `assign/user/restore` for fetching a previously stored stash, |
22 | | -and `infrastructure-actions/stash/save` for storing a new stash after a build has been completed. |
| 19 | +`Stash` provides a solution for managing large build caches in your workflows, that doesn't require any secrets and can therefore be used in fork PRs. |
| 20 | +It's designed as an alternative to `actions/cache` which struggles with big build caches such as `.ccache` directories due to it's repository wide [size limit](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) of 10GB and the fact that caches are [immutable](https://github.com/actions/toolkit/issues/505). |
| 21 | +With workflows running multiple configurations across PRs and merge commits this limit is quickly reached, leading to cache evicitions, causing CI times to increase. |
| 22 | + |
| 23 | +This action is split into two distinct operations: |
| 24 | +- `infrastructure-actions/stash/restore` for fetching a previously stored stash |
| 25 | +- `infrastructure-actions/stash/save` for storing a new stash after a build has been completed. |
23 | 26 |
|
24 | 27 | ## Features |
25 | 28 |
|
26 | | -- No repository wide size limit. Each stash is uploaded as a workflow artifact. |
27 | | - - This means there will be no cache evicition leading to cache misses and increased build times. Stashes will expire after 5 days by default. |
| 29 | +- Each stash is uploaded as a workflow artifact, in contrasts to `actions/cache` there is no repository wide size limit for artifacts. |
| 30 | + - There is no cache eviction, stashes will expire after 5 days by default. |
28 | 31 | - Artifact storage is free for public repositories and much cheaper than CI minutes (~ 1 Cent/1GB/day) for private repositories. |
29 | 32 | - No secrets required, stash can be used in fork PRs. |
30 | 33 | - Follows the same search scope as `actions/cache`: will look for the cache in the current workflow, current branch and finally the base branch of a PR. |
| 34 | +This prevents untrusted user caches (e.g. from fork PR CI runs) from being used on the default branch (where actions have elevated permissions by default) or other repo or PR branches. |
31 | 35 |
|
32 | 36 | ## Usage |
33 | 37 |
|
@@ -69,7 +73,7 @@ they are specifically modeled after `actions/cache` and `actions/upload-artifact |
69 | 73 | Please refer to the action metadata (`action.yml`) for a comprehensive list of inputs, including descriptions and default values. |
70 | 74 |
|
71 | 75 | Additionally the `restore` action has an output `stash-hit` which is set to `true` if the cache was restored successfully, |
72 | | -`false` if no cache was restored and '' if the action failed (an error will be thrown unless `continue-on-error` is set). |
73 | | -A technical limitation of composite actions like `Stash` is that all outputs are **strings**. |
74 | | -Therefor an explicit comparison has to be used when using the output: |
75 | | -`if: ${{ steps.restore-stash.outputs.stash-hit == 'true' }}` |
| 76 | +`false` if no cache was restored and '' if the action failed (an error will be thrown unless `continue-on-error` is set). |
| 77 | +A technical limitation of composite actions like `Stash` is that all outputs are **strings**. |
| 78 | +Therefore an explicit comparison has to be used when using the output: |
| 79 | +`if: ${{ steps.restore-stash.outputs.stash-hit == 'true' }}` |
0 commit comments