Keep the Expo action's caches off the GitHub cache service (#219)

The mobile OTA job uploaded the EAS CLI to the GitHub cache service
because expo-github-action caches by default. Turn both of its caches
off and have the Actions budget test reject the Expo action unless they
are off.


Claude-Session: https://claude.ai/code/session_01Wy1md9QE1ayJbDCwJ4vAQs

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
cynarAI 2026-10-20 10:34:47 +02:00 committed by GitHub
parent 263e3a31f8
commit d1dd8ffcd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View File

@ -477,6 +477,9 @@ jobs:
eas-version: latest
packager: pnpm
token: ${{ secrets.EXPO_TOKEN }}
# Its default caches go to the GitHub cache service; keep them on the runner.
eas-cache: false
expo-cache: false
- name: Install dependencies
if: steps.ota.outputs.publish == 'true' && steps.expo_token.outputs.ready == 'true'
run: pnpm install --frozen-lockfile

View File

@ -13,7 +13,18 @@ const workflows = readdirSync(directory)
return {
name,
text,
jobs: (parse(text) as { jobs: Record<string, { "runs-on"?: unknown; uses?: string }> }).jobs,
jobs: (
parse(text) as {
jobs: Record<
string,
{
"runs-on"?: unknown;
uses?: string;
steps?: Array<{ uses?: string; with?: Record<string, unknown> }>;
}
>;
}
).jobs,
};
});
@ -34,4 +45,14 @@ describe("GitHub Actions budget", () => {
expect(text).not.toContain("type=gha");
expect(text).not.toContain("setup-gradle");
});
it.each(workflows)("$name turns off the Expo action's GitHub caches", ({ jobs }) => {
for (const job of Object.values(jobs)) {
for (const step of job.steps ?? []) {
if (!step.uses?.startsWith("expo/expo-github-action")) continue;
expect(step.with?.["eas-cache"], step.uses).toBe(false);
expect(step.with?.["expo-cache"], step.uses).toBe(false);
}
}
});
});