Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/actions/configure-sccache-gha/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ runs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
// Honor an explicit job-level opt-out of the GitHub Actions cache
// backend. Long-running lanes (CUDA/ROCm/Vulkan release builds that
// exceed the ephemeral Actions cache token lifetime) set
// SCCACHE_GHA_ENABLED=false. Keep those lanes disk-only: an sccache
// server started after the token expires probes the gha tier at
// startup, and that storage read fails permanently (HTTP 400),
// aborting the build before any fail-open policy applies. Clearing the
// cache URL/token as well prevents any residual gha configuration
// from re-enabling the remote tier.
if ((process.env.SCCACHE_GHA_ENABLED || '').toLowerCase() === 'false') {
core.info(
'SCCACHE_GHA_ENABLED=false is set; using baked sccache with disk-only cache.',
);
core.exportVariable('SCCACHE_MULTILEVEL_CHAIN', 'disk');
core.exportVariable('SCCACHE_IGNORE_SERVER_IO_ERROR', '1');
core.exportVariable('ACTIONS_CACHE_URL', '');
core.exportVariable('ACTIONS_RESULTS_URL', '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', '');
Comment on lines +26 to +28

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate files =="
git ls-files | grep -E '^(\.github/actions/configure-sccache-gha/action\.ya?ml|\.agents/skills/manage-ci/SKILL\.md|^ci/ci\.md)$' || true

echo
echo "== action.yml context =="
if [ -f .github/actions/configure-sccache-gha/action.yml ]; then
  nl -ba .github/actions/configure-sccache-gha/action.yml | sed -n '1,140p'
fi

echo
echo "== manage-ci docs =="
if [ -f .agents/skills/manage-ci/SKILL.md ]; then
  nl -ba .agents/skills/manage-ci/SKILL.md | sed -n '1,220p'
fi

echo
echo "== relevant search =="
rg -n "sccache|SCCACHE|sccache_gha|ACTIONS_CACHE_URL|SCCACHE_GHA" .github .agents ci 2>/dev/null || true

Repository: Mesh-LLM/mesh-llm

Length of output: 336


🌐 Web query:

Mozilla sccache configuration SCCACHE_GHA_CACHE_URL SCCACHE_GHA_RUNTIME_TOKEN

💡 Result:

To configure sccache to use the GitHub Actions (GHA) cache, you must set specific environment variables that provide access to the GitHub Actions cache service [1][2]. Configuration Details: - SCCACHE_GHA_CACHE_URL: Specifies the GitHub Actions cache API URL [1][3]. This variable is used interchangeably or alongside ACTIONS_RESULTS_URL (which has replaced older legacy endpoints) [1][4]. - SCCACHE_GHA_RUNTIME_TOKEN: Provides the GitHub Actions access token required to authenticate with the cache service [1][5]. This works in conjunction with or as an override to the ACTIONS_RUNTIME_TOKEN environment variable [1][6]. Key Setup Requirements: - Enable the backend: You must set SCCACHE_GHA_ENABLED to on [2]. - RW Mode: You can optionally set SCCACHE_GHA_RW_MODE to READ_ONLY if you wish to restrict the cache backend from writing data [1][7]. - Cache Keys: Use SCCACHE_GHA_CACHE_TO to specify the cache key for writing and SCCACHE_GHA_CACHE_FROM to provide a comma-separated list of cache key prefixes for reading [1][6]. Note on Environment Variables: The variables prefixed with SCCACHE_GHA_ take precedence over the standard ACTIONS_ prefixed variables [6][8]. When running in a GitHub Actions workflow, these tokens and URLs are typically dynamically exported using the GitHub Actions runtime environment [2][4]. Ensure you are using current documentation, as some older guides may reference deprecated endpoint variables [4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tool checks =="
(command -v sed || true)
(command -v ast-grep || true)

echo
echo "== action.yml context =="
sed -n '1,140p' .github/actions/configure-sccache-gha/action.yml

echo
echo "== manage-ci inventory/docs snippets =="
echo "--- SKILL.md relevant lines ---"
grep -n -i -E "ci/ci\.md|configure-sccache-gha|sccache|ACTIONS_CACHE_URL|ACTIONS_RUNTIME_TOKEN|SCCACHE|inventory|CI" .agents/skills/manage-ci/SKILL.md || true
echo "--- ci/ci.md relevant lines ---"
grep -n -i -E "configure-sccache-gha|sccache|ACTIONS_CACHE_URL|ACTIONS_RUNTIME_TOKEN|SCCACHE|github" ci/ci.md || true

echo
echo "== repo-wide SCCACHE/GHA references =="
grep -Rn -i -E "SCCACHE|configure-sccache-gha|ACTIONS_CACHE_URL|ACTIONS_RUNTIME_TOKEN|ACTIONS_RESULTS_URL|SCCACHE_GHA|MULTILEVEL_CHAIN" .github .agents ci 2>/dev/null || true

Repository: Mesh-LLM/mesh-llm

Length of output: 24728


Clear sccache’s canonical GHA variables during opt-out.

This branch resets the ACTIONS_* aliases, but sccache also accepts SCCACHE_GHA_CACHE_URL and SCCACHE_GHA_RUNTIME_TOKEN, which can take precedence over the cleared values. Clear them in the SCCACHE_GHA_ENABLED=false path so inherited gha configuration cannot reactivate the remote backend if the chain changes later.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/configure-sccache-gha/action.yml around lines 26 - 28, In
the SCCACHE_GHA_ENABLED=false branch, extend the existing environment-variable
reset alongside ACTIONS_CACHE_URL, ACTIONS_RESULTS_URL, and
ACTIONS_RUNTIME_TOKEN to also clear SCCACHE_GHA_CACHE_URL and
SCCACHE_GHA_RUNTIME_TOKEN, preventing inherited GHA configuration from
reactivating the remote backend.

await exec.exec('sccache', ['--stop-server'], {
ignoreReturnCode: true,
});
const diskOnlyExitCode = await exec.exec('sccache', ['--start-server'], {
ignoreReturnCode: true,
});
if (diskOnlyExitCode !== 0) {
core.setFailed('Unable to start baked sccache with its disk-only cache.');
}
return;
}

const cacheUrl = process.env.ACTIONS_CACHE_URL || '';
const resultsUrl = process.env.ACTIONS_RESULTS_URL || '';
const runtimeToken = process.env.ACTIONS_RUNTIME_TOKEN || '';
Expand Down