Implement conditional GPG signing in CI builds to preserve validation while handling missing secrets #8
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.
The Maven CI build was failing with
gpg: signing failed: No secret keybecause the workflow was attempting to sign artifacts without proper GPG key configuration. Rather than simply skipping GPG and JavaDoc generation, this implements a conditional approach that preserves validation when possible.Problem
The
pom.xmlcontains themaven-gpg-pluginconfigured to run during the verify phase for all builds, but regular CI builds don't have access to the GPG secrets that are properly configured for releases.Solution
Updated the CI workflow with conditional logic to handle GPG keys intelligently:
mvn clean installwith both GPG signing and JavaDoc generationmvn clean install -Dgpg.skip=truebut still generates JavaDocBenefits
setup-java@v3,checkout@v4) with proper cachingThis approach ensures maximum validation coverage while gracefully handling the security constraints of fork-based contributions.
Fixes #7.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.