From 63464a90b11d56a2457f3b23fb293054c953cde1 Mon Sep 17 00:00:00 2001 From: Tom Foster Date: Sat, 6 Sep 2025 19:58:32 +0100 Subject: [PATCH] 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. --- .forgejo/actions/setup-rust/action.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.forgejo/actions/setup-rust/action.yml b/.forgejo/actions/setup-rust/action.yml index 091da8c2..f59a2140 100644 --- a/.forgejo/actions/setup-rust/action.yml +++ b/.forgejo/actions/setup-rust/action.yml @@ -91,16 +91,18 @@ runs: - name: Debug GitHub token availability shell: bash 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" else - echo "✅ GitHub token provided for sccache" + echo "✅ Using github-token input for sccache" fi - name: Setup sccache uses: https://github.com/mozilla-actions/sccache-action@v0.0.9 with: - token: ${{ inputs.github-token }} + token: ${{ env.GH_PUBLIC_RO || inputs.github-token }} - name: Cache build artifacts id: build-cache