Keep Package Publishing Credentials Out of Untrusted Builds
A build job often needs to compile code, run tests, and create an artifact. It usually does not need permission to publish a new version that other people will install. That distinction matters because build systems process code and configuration that change frequently. A pull request, dependency update, test helper, build script, or compromised developer account can influence what runs during a build. If every such build also receives a long-lived package registry credential, code that only needed to be tested may inherit authority to release software.