Skip to content

Stop a production release when the publish environment has no approval rule - #304

Merged
arifBurakDemiray merged 1 commit into
stagingfrom
release-environment-guard
Oct 22, 2026
Merged

arifBurakDemiray merged 1 commit into
stagingfrom
release-environment-guard

Conversation

@arifBurakDemiray

Copy link
Copy Markdown
Member

What

For a production release, the plan job now reads the GitHub environment the publish job runs in (maven-release) and stops the release unless it:

  • requires at least one reviewer, and
  • limits deployments to selected branches and tags (custom deployment rules).

Why

GitHub creates an environment a job names on first use, with no protection rules. maven-release does not exist yet (only maven-test does), so the first production run creates it unprotected. Once the signing and upload secrets are added to an environment like that, a release signs and uploads with no approval. A protected-branches-only policy is also rejected early: releases run on tags, which that policy refuses only after the build.

Dry runs (target: test) skip the step, so they are not blocked.

Verification

  • 69/69 release tooling tests, including two new environment_problems tests and a CLI test of check-environment.
  • Against the live API: maven-test passes; maven-release is not found, so the step fails with a clear annotation.

Not covered (choices for the owner)

  • The release key is also a repository secret: GPG_KEY, GPG_KEY_ID and GPG_KEY_PASSWORD, used by master's publishing.yml together with MAVEN_USERNAME and MAVEN_PASSWORD. Any workflow in this repository can read those without an approval, and neither the environment rules nor this check can stop that. Once publishing.yml is gone from master (the next release merge), delete the five repository secrets so the key lives only in maven-release.
  • Admin bypass (can_admins_bypass), prevent_self_review, and the actual tag patterns are not checked. maven-test already has prevent_self_review on.

🤖 Generated with Claude Code

…l rule

GitHub creates an environment that a job names on first use, with no
required reviewers and no deployment rules. For a production release the
plan job now reads the environment the publish job will run in and stops
the release unless it requires a reviewer and limits deployments to
selected branches and tags. A maven-release that has its secrets but no
approval rule cannot sign and upload unattended, and a missing one stops
here instead of after the build. A protected-branches-only policy does not
count: releases run on tags, which it would refuse only after the build.
@github-actions

Copy link
Copy Markdown

Dependency security scan

Scanned 24 resolved dependencies, failing on HIGH and above.

No known vulnerabilities in 24 resolved dependencies.

Result: passed

Full run log

@github-actions

Copy link
Copy Markdown

Unit Test Results 🚀

611 tests  ±0   611 ✅ ±0   2m 5s ⏱️ ±0s
 54 suites ±0     0 💤 ±0 
 54 files   ±0     0 ❌ ±0 

Results for commit f1fd590. ± Comparison against base commit 5c5bbde.

@github-actions

Copy link
Copy Markdown

Code coverage

module lines branches
sdk-java 90.3% (5090/5634) 81.0% (2120/2617)
sdk-java-ui 70.5% (968/1374) 63.2% (499/790)
Least covered classes (10 shown)
class module lines covered uncovered
ly.count.sdk.java.ui.JavaFxContentDisplay sdk-java-ui 10.6% (23/216) 193
ly.count.sdk.java.ui.FxSurfaces sdk-java-ui 74.8% (172/230) 58
ly.count.sdk.java.ui.ExternalBrowser sdk-java-ui 55.0% (66/120) 54
ly.count.sdk.java.ui.JavaFxWidgetHost sdk-java-ui 81.2% (190/234) 44
ly.count.sdk.java.internal.SDKCore sdk-java 87.9% (304/346) 42
ly.count.sdk.java.internal.ModuleContent sdk-java 86.0% (208/242) 34
ly.count.sdk.java.internal.TimedEvents sdk-java 60.8% (48/79) 31
ly.count.sdk.java.internal.SessionImpl sdk-java 89.4% (262/293) 31
ly.count.sdk.java.internal.SDKStorage sdk-java 84.3% (150/178) 28
ly.count.sdk.java.internal.ModuleFeedback sdk-java 86.7% (176/203) 27

Full run log

@arifBurakDemiray
arifBurakDemiray marked this pull request as ready for review October 22, 2026 05:24
@arifBurakDemiray
arifBurakDemiray merged commit bd78fea into staging Oct 22, 2026
16 checks passed
@arifBurakDemiray
arifBurakDemiray deleted the release-environment-guard branch October 22, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant