-
Notifications
You must be signed in to change notification settings - Fork 5
ci: Cache pre-commit environments in GitHub Actions #51
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: mathbunnyru <[email protected]>
|
@copilot update |
Co-authored-by: mathbunnyru <[email protected]>
Updated to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
.github/workflows/pre-commit.yml
Outdated
| path: ~/.cache/pre-commit | ||
| key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
| restore-keys: | | ||
| pre-commit-${{ runner.os }}- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot instead of runner.os let's use inputs.container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use inputs.container in the cache key. Since the container input is a JSON string with special characters, I added a step to compute a SHA256 hash of it for safe inclusion in the cache key. The implementation uses the full hash with proper error handling. See commits 8f1767c, 2992ecb, and 9e91a27.
Co-authored-by: mathbunnyru <[email protected]>
Co-authored-by: mathbunnyru <[email protected]>
Co-authored-by: mathbunnyru <[email protected]>
Add caching for pre-commit hook environments to reduce CI runtime by avoiding repeated downloads and installations of linters.
Changes
.github/workflows/pre-commit.yml: Addedactions/[email protected]step to cache~/.cache/pre-commitwith container-specific cache keysinputs.containerfor safe cache key generation.github/workflows/pre-commit-autoupdate.yml: Added identical cache configurationCache key for
pre-commit.yml:pre-commit-${{ runner.os }}-${{ steps.cache-key.outputs.suffix }}-${{ hashFiles('.pre-commit-config.yaml') }}Cache key for
pre-commit-autoupdate.yml:pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.