fix(ci): Use runner GH_PUBLIC_RO token for sccache

Prioritise GH_PUBLIC_RO environment variable (configured on runner) over
github-token input to ensure all contributors can download sccache from
GitHub releases without hitting rate limits.
This commit is contained in:
Tom Foster 2025-09-06 19:58:32 +01:00
commit 63464a90b1

View file

@ -91,16 +91,18 @@ runs:
- name: Debug GitHub token availability - name: Debug GitHub token availability
shell: bash shell: bash
run: | run: |
if [ -z "${{ inputs.github-token }}" ]; then if [ -n "$GH_PUBLIC_RO" ]; then
echo "✅ Using GH_PUBLIC_RO environment variable for sccache"
elif [ -z "${{ inputs.github-token }}" ]; then
echo "⚠️ No GitHub token provided - sccache will use fallback download method" echo "⚠️ No GitHub token provided - sccache will use fallback download method"
else else
echo "✅ GitHub token provided for sccache" echo "✅ Using github-token input for sccache"
fi fi
- name: Setup sccache - name: Setup sccache
uses: https://github.com/mozilla-actions/sccache-action@v0.0.9 uses: https://github.com/mozilla-actions/sccache-action@v0.0.9
with: with:
token: ${{ inputs.github-token }} token: ${{ env.GH_PUBLIC_RO || inputs.github-token }}
- name: Cache build artifacts - name: Cache build artifacts
id: build-cache id: build-cache