Skip to content
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

Use GITHUB_WORKFLOW to generate cache key #15

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

mlga
Copy link
Contributor

@mlga mlga commented Nov 7, 2023

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).

@milesj
Copy link
Contributor

milesj commented Nov 7, 2023

Good callout.

@milesj milesj merged commit 9c00f9c into moonrepo:master Nov 7, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants