GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `if: always()` with `cache/save` may lead to errors (fix README!) · Issue #1154 · actions/cache

if: always() with cache/save may lead to errors (fix README!) #1154

New issue
Copy link
New issue
Copy link
Closed
Closed
if: always() with cache/save may lead to errors (fix README!)#1154
Copy link
Assignees
joshmgross
Labels
documentationImprovements or additions to documentation

Description

@andreasabel
andreasabel
opened on Apr 20, 2023
Issue body actions

cache/save/README.md

Lines 83 to 84 in 04f198b

- uses: actions/cache/save@v3
if: always() // or any other condition to invoke the save action

In my experience, if we had an exact cache hit, the attempt to save the cache (under the same key) will produce an error.
So, the docs should be updated to something like

if: always() && !steps.<cache-restore-step>.outputs.cache-hit

at least in cases where we did a restore.

As cache-hit will only be true if the cache-primary-key equals the cache-matched-key this will always save the cache when it is possible.

Reacted by Mark Vander Stel and Iman Mahmoudinasab

Activity

  1. andreasabel
    changed the title [-]`if: always()` with `cache/save` will lead to errors (fix README!)[/-] [+]`if: always()` with `cache/save` may lead to errors (fix README!)[/+] on Apr 20, 2023
  2. github-actions commented on Nov 7, 2023

    @github-actions
    github-actionsBot
    on Nov 7, 2023 – with GitHub Actions
    More actions

    This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

  3. github-actions
    added
    stale
    on Nov 7, 2023
  4. andreasabel commented on Nov 8, 2023

    @andreasabel
    andreasabel
    on Nov 8, 2023
    Author
    More actions

    Issue is still unfixed:

    cache/save/README.md

    Lines 83 to 84 in 704facf

    - uses: actions/cache/save@v3
    if: always() // or any other condition to invoke the save action

  5. andreasabel commented on Nov 8, 2023

    @andreasabel
    andreasabel
    on Nov 8, 2023
    Author
    More actions

    ATTN: @bethanyj28 Please triage/fix.

  6. github-actions
    removed
    stale
    on Nov 9, 2023
  7. github-actions commented on May 27, 2024

    @github-actions
    github-actionsBot
    on May 27, 2024 – with GitHub Actions
    More actions

    This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

  8. github-actions
    added
    stale
    on May 27, 2024
  9. andreasabel commented on May 27, 2024

    @andreasabel
    andreasabel
    on May 27, 2024
    Author
    More actions

    Rather

    if: always() && steps.<cache-restore-step>.outputs.cache-hit != 'true'
    
  10. github-actions
    removed
    stale
    on May 28, 2024
  11. joshmgross
    self-assigned this
    on Aug 14, 2024
  12. joshmgross
    added
    documentationImprovements or additions to documentation
    on Aug 14, 2024
  13. joshmgross commented on Aug 14, 2024

    @joshmgross
    joshmgross
    on Aug 14, 2024
    Contributor
    More actions

    Fixing in #1452

    Reacted by Andreas Abel
  14. andreasabel commented on Aug 15, 2024

    @andreasabel
    andreasabel
    on Aug 15, 2024
    Author
    More actions

    Finally!

    Maybe fixing this one line shouldn't have taken 16 months, meanwhile leading thousands of users astray...

    Reacted by Uzair Aftab, Joanna, Andrea Bedini and Luca Zanzottera
  15. joshmgross commented on Oct 7, 2024

    @joshmgross
    joshmgross
    on Oct 7, 2024
    Contributor
    More actions

    Fixed in #1452

    Reacted by Andreas Abel
  16. joshmgross
    closed this as completedon Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @joshmgross
    joshmgross

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.