Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save cache even when job failed #1168

Open
morriq opened this issue Dec 4, 2024 · 1 comment
Open

Save cache even when job failed #1168

morriq opened this issue Dec 4, 2024 · 1 comment
Labels
feature request New feature or request to improve the current logic

Comments

@morriq
Copy link

morriq commented Dec 4, 2024

Description:
Currently, saving the cache is executed only when the job is successful:

setup-node/action.yml

Lines 38 to 39 in 39370e3

post: 'dist/cache-save/index.js'
post-if: success()

In my opinion, the job can fail for many reasons, and saving the package to the cache should be independent.

Justification:
Slowed-down job execution makes me prefer using a manual cache:

    - name: Always Save pnpm cache
      if: always() && steps.cache-pnpm.outputs.cache-hit != 'true'
      uses: actions/cache/save@v4
      with:
        path: |
          ${{ env.STORE_PATH }}
        key: ${{ steps.cache-pnpm.outputs.cache-primary-key }}

instead of cache input in action.

Are you willing to submit a PR?

@morriq morriq added feature request New feature or request to improve the current logic needs triage labels Dec 4, 2024
@priya-kinthali
Copy link

Hello @morriq 👋,
Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

2 participants