Cache not requesed (not found) between workflows
See original GitHub issueHi!
I have a shared (called) workflow, which I am reusing between few others. As an input param it receive a sha for the commit code. This sha is used as a key. As result, when I run sequently those workflows with same sha
- for the first one cache obviously is empty, so caching happened
- for the second workflow cache should be present, but it missed
Here is my called workflow
name: Prepare code
on:
workflow_call:
inputs:
commit_sha:
required: true
type: string
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: 📦 Activate cache for last commited code
id: cached-commit
uses: actions/cache@v3
with:
path: ./
key: ${{ inputs.commit_sha }}
- name: ⏬ Checkout repo last commit
if: steps.cached-commit.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
ref: ${{ inputs.commit_sha }}
And here is how I call it from 2 other workflows:
jobs:
Prepare_code:
uses: ./.github/workflows/prepare_code.yaml
with:
commit_sha: ${{ github.event.pull_request.head.sha }}
jobs:
Prepare_code:
uses: ./.github/workflows/prepare_code.yaml
with:
commit_sha: ${{ github.sha }}
Am I doing something wrong? Thanks 🙏🏼
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
can NOT find cache · Issue #539 · actions/setup-node - GitHub
A workflow can access and restore a cache created in the current branch, the base branch (including base branches of forked repositories), or ......
Read more >Github Actions Reusable workflows yarn cache not found
Therefore, if I run yarn in workflow 1's container, workflow 2 has no knowledge/access to the cache.
Read more >Edit service caching properties in ArcGIS Server Manager ...
This topic explains the map and image cache properties available in ArcGIS ... Server Manager, those dependent on geoprocessing tools are not available....
Read more >Caching Strategies - CircleCI
Order jobs to create meaningful workflows ... If no job ordering is used in a workflow all jobs run concurrently. If all the...
Read more >Between workflow caching — Snakemake 7.19.1 documentation
Hence, caching is not intended for private data, just for steps that deal with publicly available resources. Finally, be aware that the implementation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got it 😉
Thank you for your help! Have a nice day!
Unfortunately, no. Caches created on the default branch can be reused in other branches. But no other reusability is possible.