ci: fix Renovate on Forgejo (PAT + forgejo platform + token validation) #5
No reviewers
Labels
No labels
dependencies
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/pi-shared!5
Loading…
Reference in a new issue
No description provided.
Delete branch "pi/issue1-renovate-forgejo-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause
I pulled the logs from the failing run #8 and reproduced it locally. There are two distinct problems, and PR #4's
github.tokenfallback cannot fix either:1. The built-in
github.tokencannot drive Renovate on Forgejo.The auto token authenticates as the
forgejo-actionsghost user (uid-2). Renovate passes init, then dies in repo init when it lists its own PRs:Forgejo refuses to resolve
forgejo-actionsas a PR poster because it isn't a real user. Verified with both thegiteaandforgejoplatforms, sosecrets.RENOVATE_TOKEN || github.tokenis a dead end.2. The
RENOVATE_TOKENsecret is stale/invalid.Run #8 failed at init with the opaque
Authentication failure, which the ghost token does not produce (it passes init). So the workflow used a non-empty-but-invalidsecrets.RENOVATE_TOKEN— the||fallback only triggers when the secret is empty.The correct setup is the standard Renovate-on-Forgejo one: a dedicated PAT for a real account (a real user is resolvable as a PR poster).
Changes
.forgejo/workflows/renovate.ymlRENOVATE_PLATFORM: gitea->forgejo(Renovate explicitly recommends this).github.tokenfallback; usesecrets.RENOVATE_TOKENexclusively.Validate Renovate tokenstep that fails fast with an actionable message (checks the secret is present and accepted byGET /useron the in-cluster endpoint).FORGEJO_APIonce as workflow-levelenv; tightenpermissionstocontents: read.renovate.jsongithub-actions.fileMatch->managerFilePatterns(current schema) to silence the "Config needs migrating" warning.⚠️ One manual step still required
This PR makes the workflow correct, but it will keep failing until the
RENOVATE_TOKENrepo secret holds a valid Forgejo PAT for a real account. @alex please:issue,repository,workflow.RENOVATE_TOKEN(Settings -> Actions -> Secrets).Until then the job fails with the clear message above instead of the cryptic
Authentication failure.Fixes #1 (the
.github-> Forgejo port is already done; this makes the ported Renovate job actually work).