Release Cleanup: Prevent release lane from running locally#517
Merged
Conversation
Agent-Logs-Url: https://github.com/wordpress-mobile/GutenbergKit/sessions/57e55179-ee2b-493e-a228-9b809f3df5a1 Co-authored-by: mokagio <1218433+mokagio@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CI check to prevent local execution
Release Cleanup: Prevent May 17, 2026
release lane from running locally
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/517")Built from c3a21bd |
mokagio
reviewed
May 17, 2026
mokagio
approved these changes
May 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a CI-only guard to the Fastlane release lane to prevent accidental local execution of release publishing steps.
Changes:
- Aborts
releaseimmediately whenENV['CI']is not set. - Keeps existing release orchestration unchanged for CI runs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Release. For local diagnosis, invoke `validate`, `update_swift_package`, | ||
| # `publish_to_s3`, or `publish_release_to_github` individually. | ||
| lane :release do |options| | ||
| UI.user_error!('This lane must only run in CI.') unless ENV['CI'] |
jkmassel
approved these changes
May 19, 2026
Contributor
jkmassel
left a comment
There was a problem hiding this comment.
Thanks for taking care of this followup!
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.
What?
Adds a hard CI-only guard to the
releaseFastlane lane so it cannot be run outside of a CI environment.Why?
The
releaselane pushes a git tag to origin, uploads artifacts to the public S3 bucket, and creates a real GitHub Release. Running it locally by mistake would cause irreversible side effects. The lane already carried a**Don't run this locally**comment but had no enforcement.How?
Added a
UI.user_error!guard as the first statement in thereleaselane, consistent with the existing error-handling style throughout the Fastfile:If
ENV['CI']is not set, the lane aborts immediately with a message pointing to the individual lanes suitable for local use.Testing Instructions
bundle exec fastlane release version:v0.0.0-test(withoutCIset in the environment).CI=true bundle exec fastlane release version:v0.0.0-testto confirm the guard passes and the lane continues normally (it will fail later on missing credentials/artifacts, which is expected).Accessibility Testing Instructions
N/A — no UI changes.
Screenshots or screencast