Skip to content

Commit 66961b3

Browse files
authored
Rename PULL_REQUEST_NUMBER to pull_request_number (#16435)
2 parents f5f24eb + c96ea40 commit 66961b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fastlane/Fastfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ WORKSPACE_PATH = File.join(PROJECT_ROOT_FOLDER, 'WooCommerce.xcworkspace')
2929
FIREBASE_APP_ID = '1:124902176124:ios:02259de1e7c42b291620f9'
3030
FIREBASE_TESTERS_GROUP = 'woocommerce-ios---prototype-builds'
3131

32+
# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR
33+
pull_request_number = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) }
34+
3235
BUILDKITE_RELEASE_PIPELINE = 'release-builds.yml'
3336
IOS_LOCALES = %w[ar-SA de-DE en-US es-ES fr-FR he id it ja ko nl-NL pt-BR ru sv tr zh-Hans zh-Hant].freeze
3437
SIMULATOR_VERSION = '18.5' # For screenshots
@@ -780,7 +783,7 @@ platform :ios do
780783
Branch: `#{ENV.fetch('BUILDKITE_BRANCH', 'N/A')}`
781784
Commit: #{ENV.fetch('BUILDKITE_COMMIT', 'N/A')[0...7]}
782785
NOTES
783-
release_notes += "Pull Request: ##{PULL_REQUEST_NUMBER}" unless PULL_REQUEST_NUMBER.nil?
786+
release_notes += "Pull Request: ##{pull_request_number}" unless pull_request_number.nil?
784787

785788
firebase_app_distribution(
786789
app: FIREBASE_APP_ID,
@@ -796,13 +799,13 @@ platform :ios do
796799
dsym_path: './build/WooCommerce.app.dSYM.zip'
797800
)
798801

799-
next if PULL_REQUEST_NUMBER.nil?
802+
next if pull_request_number.nil?
800803

801804
# PR Comment
802805
comment_body = prototype_build_details_comment(app_display_name: 'WooCommerce iOS Prototype')
803806
comment_on_pr(
804807
project: GITHUB_REPO,
805-
pr_number: PULL_REQUEST_NUMBER,
808+
pr_number: pull_request_number,
806809
reuse_identifier: 'prototype-build-link',
807810
body: comment_body
808811
)
@@ -812,7 +815,7 @@ platform :ios do
812815
lane :build_for_prototype_build do |fetch_code_signing: true|
813816
update_certs_and_profiles_enterprise if fetch_code_signing
814817

815-
pr_prefix = PULL_REQUEST_NUMBER&.then { |num| "pr#{num}" }
818+
pr_prefix = pull_request_number&.then { |num| "pr#{num}" }
816819
commit_short_hash = ENV.fetch('BUILDKITE_COMMIT', '0')[0...7]
817820
build_number = [pr_prefix, commit_short_hash].compact.join('-')
818821

@@ -1526,9 +1529,6 @@ TEST_ANALYTICS_ENVIRONMENT = %w[
15261529
# Release Management Utils
15271530
# -----------------------------------------------------------------------------------
15281531

1529-
# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR
1530-
PULL_REQUEST_NUMBER = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) }
1531-
15321532
def create_backmerge_pr
15331533
version = release_version_current
15341534

0 commit comments

Comments
 (0)