nit: added language to code blocks

This commit is contained in:
Sankalp Kotewar 2022-12-15 09:05:17 +00:00 committed by GitHub
parent da311f75a6
commit 05c9b49ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -19,7 +19,7 @@ This action has no outputs.
In case you are using separate jobs for generating common artifacts and sharing them across different jobs, this action will help you with your save only needs.
```
```yaml
steps:
- uses: actions/checkout@v3
@ -43,7 +43,7 @@ With save action, the key can now be re-evaluated while executing the action. Th
Let's say we have a restore step that computes key at runtime
```
```yaml
uses: actions/cache/restore@v3
id: restore-cache
with:
@ -51,14 +51,14 @@ with:
```
Case 1: Where an user would want to reuse the key as it is
```
```yaml
uses: actions/cache/save@v3
with:
key: steps.restore-cache.output.key
```
Case 2: Where the user would want to re-evaluate the key
```
```yaml
uses: actions/cache/save@v3
with:
key: npm-cache-${{hashfiles(package-lock.json)}}
@ -68,7 +68,7 @@ with:
There are instances where some flaky test cases would fail the entire workflow and users would get frustrated because the builds would run for hours and the cache couldn't get saved as the workflow failed in between. For such use-cases, users would now have the ability to use `actions/cache/save` action to save the cache by using `if: always()` condition. This way the cache will always be saved if generated, or a warning will be thrown that nothing is found on the cache path. Users can also use the `if` condition to only execute the `actions/cache/save` action depending on the output of the previous steps. This way they get more control on when to save the cache.
```
```yaml
steps:
- uses: actions/checkout@v3
.