From 05c9b49ea4c9743a2748017519724e29c6776756 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Thu, 15 Dec 2022 09:05:17 +0000 Subject: [PATCH] nit: added language to code blocks --- restore/README.md | 8 ++++---- save/README.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/restore/README.md b/restore/README.md index 7adb324..0c60cc2 100644 --- a/restore/README.md +++ b/restore/README.md @@ -28,7 +28,7 @@ As this is a newly introduced action to give users more control in their workflo In case you are using another workflow to create and save your cache that can be reused by other jobs in your repository, this action will take care of your restore only needs. -``` +```yaml steps: - uses: actions/checkout@v3 @@ -57,7 +57,7 @@ In case of multi-module projects, where the built artifact of one project needs #### Step 1 - Build the parent module and save it -``` +```yaml steps: - uses: actions/checkout@v3 @@ -72,7 +72,7 @@ steps: ``` #### Step 2 - Restore the built artifact from cache using the same key and path -``` +```yaml steps: - uses: actions/checkout@v3 @@ -97,7 +97,7 @@ steps: You can use the output of this action to exit the workflow on cache miss. This way you can restrict your workflow to only initiate the build when `cache-hit` occurs, in other words, cache with exact key is found. -``` +```yaml steps: - uses: actions/checkout@v3 diff --git a/save/README.md b/save/README.md index 390af0b..4d98fd1 100644 --- a/save/README.md +++ b/save/README.md @@ -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 .