Bind publish job to Main environment#189
Merged
Merged
Conversation
Secrets are declared at the environment level (Main), not at the repo level. Without binding the publish job to that environment, GitHub Actions injects empty values for MAVEN_CENTRAL_* and GPG_*, causing signing to fail with "Could not read PGP secret key".
Review Summary by QodoBind publish job to Main environment for secrets
WalkthroughsDescription• Bind publish job to Main environment for secret access • Fixes signing failures due to empty secret injection • Resolves root cause of failed v1.0.0-Beta1 tag publish Diagramflowchart LR
A["Publish Job"] -- "environment: Main" --> B["Access Environment Secrets"]
B --> C["MAVEN_CENTRAL_* & GPG_*"]
C --> D["Gradle Signing Plugin"]
D --> E["Successful Maven Central Upload"]
File Changes1. .github/workflows/publish.yml
|
There was a problem hiding this comment.
Pull request overview
Binds the publish job in publish.yml to the Main GitHub Actions environment so that environment-scoped secrets (Maven Central credentials and GPG signing key) are injected into the workflow, fixing the failing tag publish where empty secrets caused Could not read PGP secret key.
Changes:
- Add
environment: Mainto thepublishjob in.github/workflows/publish.yml.
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
Main), not at the repo level.environment: Mainon the publish job, GitHub Actions injects empty values into${{ secrets.* }}, surfacing asCould not read PGP secret keywhen Gradle's signing plugin tries to use an emptysigningInMemoryKey.Test plan
:featured-bom:signMavenPublicationto succeed and bundle to upload to Central Portal.dev.androidbroadcast.featured:1.0.0-Beta1appears inVALIDATEDstatus (local publish already produced one — this CI bundle will be the second).