While utilizing "Reusable Workflows", using GITHUB_JOB env variable alone is not sufficient. Across all the child workflows which call a reusable workflow,GITHUB_JOB will contain the same name.
Since this pattern is often used in monorepos hosting multiple services or libraries with independent dependencies, cache should be generated per-workflow as well.
In typical use case of having completely separated workflow definitions, the cache is also guaranteed not to be shared across workflows (even if job ID is duplicated intentionally or by accident).
While utilizing "Reusable Workflows", using
GITHUB_JOB
env variable alone is not sufficient. Across all the child workflows which call a reusable workflow,GITHUB_JOB
will contain the same name.Since this pattern is often used in monorepos hosting multiple services or libraries with independent dependencies, cache should be generated per-workflow as well.
In typical use case of having completely separated workflow definitions, the cache is also guaranteed not to be shared across workflows (even if job ID is duplicated intentionally or by accident).