Skip to content

Release Cleanup: Prevent release lane from running locally#517

Merged
jkmassel merged 3 commits into
trunkfrom
copilot/release-cleanup-dont-run-locally
May 19, 2026
Merged

Release Cleanup: Prevent release lane from running locally#517
jkmassel merged 3 commits into
trunkfrom
copilot/release-cleanup-dont-run-locally

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

What?

Adds a hard CI-only guard to the release Fastlane lane so it cannot be run outside of a CI environment.

Why?

The release lane 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 the release lane, consistent with the existing error-handling style throughout the Fastfile:

lane :release do |options|
  UI.user_error!('This lane must only run in CI. Use individual lanes (validate, update_swift_package, publish_to_s3, publish_release_to_github) for local diagnosis.') unless ENV['CI']
  ...
end

If ENV['CI'] is not set, the lane aborts immediately with a message pointing to the individual lanes suitable for local use.

Testing Instructions

  1. Locally, run bundle exec fastlane release version:v0.0.0-test (without CI set in the environment).
  2. Confirm the lane aborts with the error message and does not proceed to push any tag or upload any artifact.
  3. Re-run with CI=true bundle exec fastlane release version:v0.0.0-test to 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

Copilot AI linked an issue May 17, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add CI check to prevent local execution Release Cleanup: Prevent release lane from running locally May 17, 2026
Copilot AI requested a review from mokagio May 17, 2026 22:15
@wpmobilebot
Copy link
Copy Markdown

wpmobilebot commented May 17, 2026

XCFramework Build

This PR's XCFramework is available for testing. Add the following to your Package.swift:

.package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/517")

Built from c3a21bd

Comment thread fastlane/Fastfile Outdated
@mokagio mokagio added the [Type] Enhancement A suggestion for improvement. label May 17, 2026
@mokagio mokagio marked this pull request as ready for review May 18, 2026 07:42
@mokagio mokagio requested review from Copilot and jkmassel May 18, 2026 07:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a CI-only guard to the Fastlane release lane to prevent accidental local execution of release publishing steps.

Changes:

  • Aborts release immediately when ENV['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.

Comment thread fastlane/Fastfile
# 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']
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this followup!

@jkmassel jkmassel merged commit adaae7b into trunk May 19, 2026
26 of 27 checks passed
@jkmassel jkmassel deleted the copilot/release-cleanup-dont-run-locally branch May 19, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release Cleanup: don't allow running locally

5 participants