The token lookup only read PATs from tea's config — with tea's OAuth login the config has no token, so the script silently continued with an empty one and failed 30 minutes later at the upload step. Fall back to the git credential store (the access token stored by every git push, accepted by Gitea for API auth), and error out immediately when nothing is found instead of burning a full build.