{"id":12673453,"name":"capnspacehook/cache-go","ecosystem":"actions","description":"Cache Go module and build files more efficiently","homepage":"","licenses":"mit","normalized_licenses":["MIT"],"repository_url":"https://github.com/capnspacehook/cache-go","keywords_array":["cache","github-actions","go","golang"],"namespace":"capnspacehook","versions_count":8,"first_release_published_at":"2023-09-21T14:19:32.000Z","latest_release_published_at":"2025-11-06T17:45:45.000Z","latest_release_number":"v2.0.1","last_synced_at":"2026-01-11T17:32:18.716Z","created_at":"2026-01-11T17:32:15.860Z","updated_at":"2026-01-11T17:32:18.716Z","registry_url":"https://github.com/capnspacehook/cache-go","install_command":null,"documentation_url":null,"metadata":{"name":"Cache Go files efficiently","description":"Cache Go module and build files more efficiently","author":"Andrew LeFevre","inputs":{"mod-key":{"description":"An explicit key for restoring and saving the module cache","required":false},"mod-restore-key":{"description":"A prefix of `mod-key` to use to restore a stale cache if no cache hit occurred for `mod-key`","required":false},"build-key":{"description":"An explicit key for restoring and saving the build cache","required":false},"build-restore-key":{"description":"A prefix of `build-key` to use to restore a stale cache if no cache hit occurred for `build-key`","required":false}},"outputs":{"mod-cache-hit":{"description":"A boolean value to indicate if the module cache was hit","value":"${{ steps.check-caches.outputs.mod-cache-hit }}"},"build-cache-hit":{"description":"A boolean value to indicate if the build cache was hit","value":"${{ steps.check-caches.outputs.build-cache-hit }}"}},"runs":{"using":"composite","steps":[{"name":"Get Go cache locations","id":"go-cache-loc","shell":"bash","run":"echo \"go-mod-cache=$(go env GOMODCACHE)\" \u003e\u003e \"${GITHUB_OUTPUT}\"\necho \"go-build-cache=$(go env GOCACHE)\" \u003e\u003e \"${GITHUB_OUTPUT}\"\n"},{"name":"Set default cache keys if necessary","id":"cache-keys","shell":"bash","run":"MOD_KEY=\"${{ inputs.mod-key }}\"\nMOD_RESTORE_KEY=\"${{ inputs.mod-restore-key }}\"\nBUILD_KEY=\"${{ inputs.build-key }}\"\nBUILD_RESTORE_KEY=\"${{ inputs.build-restore-key }}\"\n\nGO_VERSION=\"$(go version | grep -Po '\\d\\.\\d\\d\\.\\d+')\"\n\nif [[ -z $MOD_KEY ]]; then\n  MOD_KEY=\"${{ github.job }}-mod-${{ hashFiles('**/go.sum') }}\"\n  MOD_RESTORE_KEY=\"${{ github.job }}-mod-\"\nfi\nif [[ -z $BUILD_KEY ]]; then\n  BUILD_KEY=\"${{ github.job }}-${{ runner.os }}-${GO_VERSION}-${{ github.run_id }}-${{ github.run_attempt }}\"\n  BUILD_RESTORE_KEY=\"${{ github.job }}-${{ runner.os }}-${GO_VERSION}-\"\nfi\n\necho \"mod-key=${MOD_KEY}\" \u003e\u003e \"${GITHUB_OUTPUT}\"\necho \"mod-restore-key=${MOD_RESTORE_KEY}\" \u003e\u003e \"${GITHUB_OUTPUT}\"\necho \"build-key=${BUILD_KEY}\" \u003e\u003e \"${GITHUB_OUTPUT}\"\necho \"build-restore-key=${BUILD_RESTORE_KEY}\" \u003e\u003e \"${GITHUB_OUTPUT}\"\n"},{"name":"Handle Go module cache","id":"go-mod-cache","uses":"actions/cache@v4","with":{"path":"${{ steps.go-cache-loc.outputs.go-mod-cache }}","key":"${{ steps.cache-keys.outputs.mod-key }}","restore-keys":"${{ steps.cache-keys.outputs.mod-restore-key }}\n","save-always":true}},{"name":"Handle Go build cache","id":"go-build-cache","uses":"actions/cache@v4","with":{"path":"${{ steps.go-cache-loc.outputs.go-build-cache }}","key":"${{ steps.cache-keys.outputs.build-key }}","restore-keys":"${{ steps.cache-keys.outputs.build-restore-key }}\n","save-always":true}},{"name":"Check caches","id":"check-caches","shell":"bash","run":"MOD_CACHE_HIT=\"false\"\nif [[ -d ${{ steps.go-cache-loc.outputs.go-mod-cache }} ]]; then\n  MOD_CACHE_HIT=\"true\"\nfi\n\nBUILD_CACHE_HIT=\"false\"\nif [[ -d ${{ steps.go-cache-loc.outputs.go-build-cache }} ]]; then\n  BUILD_CACHE_HIT=\"true\"\nfi\n\necho \"mod-cache-hit=${MOD_CACHE_HIT}\" \u003e\u003e \"${GITHUB_OUTPUT}\"\necho \"build-cache-hit=${BUILD_CACHE_HIT}\" \u003e\u003e \"${GITHUB_OUTPUT}\"\n"}]},"default_branch":"master","path":null},"repo_metadata":{},"repo_metadata_updated_at":null,"dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{},"purl":"pkg:githubactions/capnspacehook/cache-go","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/actions/capnspacehook/cache-go","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/actions/capnspacehook/cache-go","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/actions/capnspacehook/cache-go/dependencies","status":"removed","funding_links":[],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/capnspacehook%2Fcache-go/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/capnspacehook%2Fcache-go/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/capnspacehook%2Fcache-go/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/capnspacehook%2Fcache-go/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/capnspacehook%2Fcache-go/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/capnspacehook%2Fcache-go/codemeta","maintainers":[]}