-
Notifications
You must be signed in to change notification settings - Fork 0
adding action/cache #75
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
PR Checklist (required):
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Pull Request Overview
This PR adds caching for the Terraform plugin directory in the composite GitHub Action to speed up workflow runs and optionally inspect the cache contents.
- Introduces
TF_PLUGIN_CACHE_DIR
environment variable - Ensures the plugin cache directory exists and is persisted using
actions/cache
- Adds a debug step to list cache contents
Comments suppressed due to low confidence (1)
action.yml:135
- [nitpick] Consider gating this debug step behind an input flag or removing it in production to avoid cluttering logs.
- name: List Plugin Cache Contents
action.yml
Outdated
# Use a key that makes sense for your setup. | ||
# Hashing .terraform.lock.hcl is good if you have one at the root | ||
# or a specific one for the validated project. | ||
key: tenant-tofu-plugin-cache |
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.
Use a dynamic cache key to automatically bust the cache when dependencies change. For example:
key: tenant-tofu-plugin-cache-${{ hashFiles('**/.terraform.lock.hcl') }}
key: tenant-tofu-plugin-cache | |
key: tenant-tofu-plugin-cache-${{ hashFiles('**/.terraform.lock.hcl') }} |
Copilot uses AI. Check for mistakes.
action.yml
Outdated
@@ -112,6 +129,14 @@ runs: | |||
workspace: ${{ inputs.workspace }} | |||
backend_config: ${{ inputs.backend_config }} | |||
backend_config_file: ${{ inputs.backend_config_file }} | |||
|
|||
|
|||
#You can add a step to see the contents of the plugin cache for debugging if needed |
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.
[nitpick] Add a space after the hash for consistency with comment style, e.g.:
You can add a step to see the contents of the plugin cache for debugging if needed
#You can add a step to see the contents of the plugin cache for debugging if needed | |
# You can add a step to see the contents of the plugin cache for debugging if needed |
Copilot uses AI. Check for mistakes.
PR Type
enhancement
Description
Add Terraform plugin cache directory setup and caching.
Integrate GitHub Actions cache for plugin cache directory.
Add debug step to list plugin cache contents.
Changes walkthrough 📝
action.yml
Add and cache Terraform plugin cache directory in workflow
action.yml
TF_PLUGIN_CACHE_DIR
environment variable for plugin caching.actions/cache
to cache the plugin cache directory.