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

Do not restore state if the cache does not exist #1057

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

dsame
Copy link
Contributor

@dsame dsame commented Jul 21, 2023

Description:
Use https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#list-github-actions-caches-for-a-repository
to check if the cache exists and skip the restore if it does not.

Logging is also changed, since state recovery can only fail because of the error.

e2e run: https://github.com/akv-demo/test-stale/actions/runs/5615517213/job/15215993242

Related issue:
link to the original issue.
link to the related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@dsame dsame requested a review from a team as a code owner July 21, 2023 05:47
@dsame dsame changed the title Do not restore save if the cache does not exist Do not restore state if the cache does not exist Jul 21, 2023
@dsame dsame marked this pull request as draft July 21, 2023 05:53
@dsame dsame assigned dsame and unassigned dsame Jul 21, 2023
@dsame dsame marked this pull request as ready for review July 21, 2023 11:22
Copy link
Contributor

@nikolai-laevskii nikolai-laevskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from minor naming issues lgtm

src/classes/state/state-cache-storage.ts Outdated Show resolved Hide resolved
src/classes/state/state-cache-storage.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@dusan-trickovic dusan-trickovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dsame dsame merged commit 60f5158 into actions:main Jul 27, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants