Skip to content

Conversation

@itchyny
Copy link

@itchyny itchyny commented Apr 10, 2024

Description:
This PR fixes #1136, also fixes a TODO comment about using octokit methods.

Related issue:

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.
    • These methods are not covered by existing tests, possibly because they interact with the GitHub APIs.

@itchyny itchyny requested a review from a team as a code owner April 10, 2024 08:54
@Georgegriff
Copy link

I think i ran into this issue, do you know if its likely this pr might progress?

@itchyny
Copy link
Author

itchyny commented Jun 24, 2024

I hope some maintainer will look into this PR, but maintenance activity of this action looks to be stale.

@echang49
Copy link

echang49 commented Aug 2, 2024

Would love for a maintainer to merge this fix in. Have a feature that's built on top of this that's needed internally and will definitely help others.

@echang49 echang49 mentioned this pull request Aug 2, 2024
2 tasks
@Dreamsorcerer
Copy link

Dreamsorcerer commented Oct 1, 2024

@Jcambass @HarithaVattikuti @priyagupta108 Can someone merge this PR? The action is completely broken for many repos without this. We have stale issues that should have been closed weeks ago, but will never close until this fix is released.

@thehowl
Copy link

thehowl commented Aug 11, 2025

@chiranjib-swain Friendly ping to take a look at this :)

@chiranjib-swain
Copy link
Contributor

Hi @itchyny, thanks for the PR!

It looks like the formatting check failed during CI. The following file(s) need to be formatted with Prettier:

src/classes/state/state-cache-storage.ts

Could you please run Prettier locally and commit the updated formatting? You can do this with:

npm run format

This will ensure your changes pass the formatting check.

Additionally, the PR is based on an older commit, which is causing errors like:

Failed to save:

Our services aren't available right now

When you get a chance, could you please merge the latest updates from the main branch into your PR?
This should resolve the issue and ensure everything builds correctly with the latest changes.

Thanks again for your contribution!

Copilot AI review requested due to automatic review settings December 5, 2025 07:51
@itchyny itchyny force-pushed the fix-state-cache-check branch from 0980a21 to 4777cc4 Compare December 5, 2025 07:51
@itchyny
Copy link
Author

itchyny commented Dec 5, 2025

@chiranjib-swain
Rebase and format done!

Copilot finished reviewing on behalf of itchyny December 5, 2025 07:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #1136 related to checking the state cache and modernizes the codebase by switching from raw HTTP requests to typed Octokit REST API methods.

Key changes:

  • Replaced client.request() calls with proper client.rest.actions.* methods for better type safety and maintainability
  • Fixed cache checking logic by using caches.some() instead of Boolean(caches.find()) for more idiomatic JavaScript
  • Improved variable naming from issueResult to cachesResult for better clarity

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/classes/state/state-cache-storage.ts Updated cache checking and deletion functions to use Octokit REST API methods instead of raw HTTP requests, improving type safety and code maintainability
dist/index.js Compiled/bundled output reflecting the source code changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cachesResult.data['actions_caches'] || [];
return caches.some(cache => cache['key'] === cacheKey);
} catch (error) {
core.debug(`Error checking if cache exist: ${error.message}`);
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Spelling error: "exist" should be "exists".

Suggested change
core.debug(`Error checking if cache exist: ${error.message}`);
core.debug(`Error checking if cache exists: ${error.message}`);

Copilot uses AI. Check for mistakes.
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.

State restoration fails if a repo has many caches

7 participants