ci: fix 401 resolving MrCrayfish GitHub Packages deps - #4
Merged
Conversation
The MrCrayfish GitHub Packages Maven repo in build.gradle.kts reads these via "github_actor"/"github_token".localOrEnv, but neither is auto-injected into a run: step's shell environment - so that repo's dependency requests (catalogue-common, etc.) went out unauthenticated and GitHub Packages returned 401, failing dependency resolution before any test could run. May not be fully sufficient on its own: the default GITHUB_TOKEN is scoped to this repo, and cross-owner GitHub Packages reads commonly need a real PAT with read:packages granted access to MrCrayfish's packages specifically. If CI still 401s after this, that's the next thing to check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions check workflow to export GITHUB_ACTOR/GITHUB_TOKEN into the job environment so Gradle can authenticate to MrCrayfish’s GitHub Packages Maven repo during dependency resolution, avoiding CI failures caused by 401 Unauthorized responses.
Changes:
- Add job-level
envexports forGITHUB_ACTORandGITHUB_TOKENso./gradlew checkruns with the credentialsbuild.gradle.ktsexpects. - Document the rationale and known limitations (may still require a PAT with
read:packagesfor cross-owner package access).
Suppressed comments (1)
.github/workflows/check.yaml:43
- Setting
GITHUB_TOKENat the job level exports it to every step and 3rd‑party action in this workflow, which increases blast radius if any step/action is compromised. Prefer scoping the token to only the Gradle invocation that needs GitHub Packages auth (e.g.,env:on the “Run check” step).
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
maven.resourcefulbees.com now 200s with an HTML redirect page (to maven.knifepoint.net) for paths it doesn't actually mirror, instead of 404ing. Since it was declared unscoped, Gradle tried it for every unresolved dependency, including androidx.collection/androidx.annotation (pulled in transitively by Compose Desktop's runtime), and hard-failed trying to parse the redirect HTML as module metadata instead of falling through to a repo that has them. - Scope the resourcefulbees repo to the one group it's genuinely still needed for (earth.terrarium.common_storage_lib). - Add google(), scoped to androidx.*/com.android.*, since that's where those artifacts actually live (mavenCentral 404s on them). Verified locally: :Archie:fabric:dependencies --configuration bundleRuntimeLibraryConfiguration now resolves cleanly.
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI's `check` job was failing at dependency resolution (before any test ran) with:
```
Could not GET '.../catalogue-common-1.21.1-1.11.0.pom'. Received status code 401 from server: Unauthorized
```
`build.gradle.kts`'s MrCrayfish GitHub Packages Maven repo block reads `GITHUB_ACTOR`/`GITHUB_TOKEN` via `"github_actor"/"github_token".localOrEnv`, but neither was ever passed into the `Run check` step's shell environment - so the request went out unauthenticated and GitHub Packages 401'd (it requires auth even for public package reads).
Added both as job-level `env:` so every step (including `Run check`) inherits them.
Heads up - this may not be fully sufficient on its own: `secrets.GITHUB_TOKEN` is scoped to this repo, and cross-owner GitHub Packages reads commonly need a real PAT (with `read:packages`) that's been granted access to MrCrayfish's packages specifically. If CI still 401s after this merges, that's the next thing to check - likely needs a dedicated PAT stored as a repo secret and swapped in for `GITHUB_TOKEN` in this same env block.
Test plan
🤖 Generated with Claude Code