fastlane-plugin-stream_actions 0.3.110 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 888040fa838377d07267e268981a57c1048366fd7fea2be4950add10b8ccbda9
4
- data.tar.gz: cb0e764c0e0344c499eb412ee9128edc96a0b28a16f390466872c4a6c00442f6
3
+ metadata.gz: 98ea1940f8aa3135975f332a499eb1d755e31f01c5d5bedb28f19d807fd164ea
4
+ data.tar.gz: c583a39f54b3acc092486c66877c9453bd6fb9e2b0013b02bad309e9e7165c33
5
5
  SHA512:
6
- metadata.gz: fff03b80bee94801487a99bb50317ef7d63728b4fc0a78f2c18bbcc712fff1481edca9ab571f4af64a0ce24d30e2ba9bc15d7f483859d7514e5b68198bb5bf21
7
- data.tar.gz: 14bb9e6f1159bd7c67041eb13f477ce488f6f6a126befe669de7803f32b89f1ed2955f24a529c2682bd2026d3a62a0d638869e5a99f5e7608b27c7aa987695d8
6
+ metadata.gz: ecdaab8fb0a7311bdd636132be1ee212c60d40935df5787a3d13c6284dd262c6274310995f73119f5bf14993ea34ca154b1979240452902299f9a31b648bc0bc
7
+ data.tar.gz: 204c24b4512c844608a14e7555de811fd8c20f4a40084548c1fe975c0dca6e229bbe29d2cbbf43a58d101149157ef4744ab9f92502c4c780c2754d693ade5b8a
@@ -0,0 +1,37 @@
1
+ module Fastlane
2
+ module Actions
3
+ class CoreVersionAction < Action
4
+ def self.run(params)
5
+ version = params[:version]
6
+ return nil if version.nil? || version.to_s.strip.empty?
7
+
8
+ m = version.to_s.match(/(\d+)\.(\d+)\.(\d+)/)
9
+ UI.user_error!("Version must contain major.minor.patch (e.g. 1.2.3), got: #{version}") unless m
10
+
11
+ "#{m[1]}.#{m[2]}.#{m[3]}"
12
+ end
13
+
14
+ #####################################################
15
+ # @!group Documentation
16
+ #####################################################
17
+
18
+ def self.description
19
+ 'Returns major.minor.patch from a version string (e.g. 1.2.3-beta -> 1.2.3) for plist / CFBundleShortVersionString'
20
+ end
21
+
22
+ def self.available_options
23
+ [
24
+ FastlaneCore::ConfigItem.new(
25
+ key: :version,
26
+ description: 'Version string to normalize; nil or empty returns nil',
27
+ optional: true
28
+ )
29
+ ]
30
+ end
31
+
32
+ def self.is_supported?(platform)
33
+ true
34
+ end
35
+ end
36
+ end
37
+ end
@@ -6,11 +6,11 @@ module Fastlane
6
6
 
7
7
  UI.message("Checking if check is required for PR ##{params[:github_pr_num]}")
8
8
 
9
- changed_files = Actions.sh("gh pr view #{params[:github_pr_num]} --json files -q '.files[].path'").split("\n")
9
+ changed_files = self.changed_file_paths(params)
10
10
 
11
11
  too_many_files = changed_files.size > 99 # TODO: https://github.com/cli/cli/issues/5368
12
12
  if too_many_files
13
- UI.important("Check it required because there were too many files changed.")
13
+ UI.important("Check is required because there were too many files changed.")
14
14
  return true
15
15
  end
16
16
 
@@ -23,6 +23,42 @@ module Fastlane
23
23
  is_check_required
24
24
  end
25
25
 
26
+ # For pull_request: use full PR for `opened` (etc.); for `synchronize` pass
27
+ # github_event_before/after (e.g. github.event.before/after) to scope to this push.
28
+ def self.changed_file_paths(params)
29
+ action = params[:github_event_action].to_s
30
+ before = params[:github_event_before].to_s.strip
31
+ after = params[:github_event_after].to_s.strip
32
+ repo = (params[:github_repository] || ENV['GITHUB_REPOSITORY']).to_s
33
+
34
+ if action == 'synchronize' && !before.empty? && !after.empty? && !repo.empty?
35
+ if before.match?(/\A0+\z/) || !before.match?(/\A[0-9a-f]{7,40}\z/i) || !after.match?(/\A[0-9a-f]{7,40}\z/i)
36
+ UI.important("Invalid before/after for compare; falling back to full PR file list")
37
+ else
38
+ out = self.compare_push_files(repo, before, after)
39
+ return out unless out.nil?
40
+
41
+ UI.important("Could not list push diff (e.g. fork/cross-repo); falling back to full PR file list")
42
+ end
43
+ end
44
+
45
+ self.gh_path_lines(Actions.sh("gh pr view #{params[:github_pr_num]} --json files -q '.files[].path'"))
46
+ end
47
+
48
+ def self.compare_push_files(repo, before, after)
49
+ self.gh_path_lines(Actions.sh(
50
+ "gh api \"repos/#{repo}/compare/#{before}...#{after}\" " \
51
+ "-H \"Accept: application/vnd.github.v3+json\" " \
52
+ "-q '.files[].filename'"
53
+ ))
54
+ rescue StandardError
55
+ nil
56
+ end
57
+
58
+ def self.gh_path_lines(output)
59
+ output.to_s.split("\n", -1).map(&:strip).reject(&:empty?)
60
+ end
61
+
26
62
  #####################################################
27
63
  # @!group Documentation
28
64
  #####################################################
@@ -52,6 +88,31 @@ module Fastlane
52
88
  description: 'GitHub PR number',
53
89
  optional: true,
54
90
  is_string: false
91
+ ),
92
+ FastlaneCore::ConfigItem.new(
93
+ env_name: 'GITHUB_EVENT_ACTION',
94
+ key: :github_event_action,
95
+ description: 'pull_request action: e.g. opened, synchronize. When synchronize and before/after ' \
96
+ 'are set, only files in that push are considered',
97
+ optional: true
98
+ ),
99
+ FastlaneCore::ConfigItem.new(
100
+ env_name: 'GITHUB_EVENT_BEFORE',
101
+ key: :github_event_before,
102
+ description: 'github.event.before (head ref before the push) for pull_request',
103
+ optional: true
104
+ ),
105
+ FastlaneCore::ConfigItem.new(
106
+ env_name: 'GITHUB_EVENT_AFTER',
107
+ key: :github_event_after,
108
+ description: 'github.event.after (head ref after the push) for pull_request',
109
+ optional: true
110
+ ),
111
+ FastlaneCore::ConfigItem.new(
112
+ env_name: 'GITHUB_REPOSITORY',
113
+ key: :github_repository,
114
+ description: 'owner/repo; required for push-scoped file list (defaults to GITHUB_REPOSITORY in CI)',
115
+ optional: true
55
116
  )
56
117
  ]
57
118
  end
@@ -4,15 +4,21 @@ module Fastlane
4
4
  def self.run(params)
5
5
  ensure_everything_is_set_up(params)
6
6
 
7
+ version_acceptable_for_plist = other_action.core_version(version: params[:version])
8
+
7
9
  version_number = ''
8
10
  params[:sdk_names].each do |target|
11
+ # Assigning is required because the version could have been passed via :bump_type
9
12
  version_number = other_action.increment_version_number_in_plist(
10
13
  target: target,
11
- version_number: params[:version],
14
+ version_number: version_acceptable_for_plist,
12
15
  bump_type: params[:bump_type]
13
16
  )
14
17
  end
15
18
 
19
+ # Reassigning is required if the version was passed via :version to keep postfix such as "-beta" if exists
20
+ version_number = params[:version] if params[:version]
21
+
16
22
  ensure_release_tag_is_new(version_number)
17
23
 
18
24
  changes =
@@ -14,8 +14,9 @@ module Fastlane
14
14
  end
15
15
 
16
16
  if params[:app_version]
17
+ version_acceptable_for_plist = other_action.core_version(version: params[:app_version])
17
18
  targets.each do |target|
18
- other_action.increment_version_number_in_plist(version_number: params[:app_version].to_s, target: target)
19
+ other_action.increment_version_number_in_plist(version_number: version_acceptable_for_plist, target: target)
19
20
  end
20
21
  else
21
22
  Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key])
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.110'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.110
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-20 00:00:00.000000000 Z
11
+ date: 2026-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list
@@ -234,6 +234,7 @@ files:
234
234
  - lib/fastlane/plugin/stream_actions/actions/allure_run_testplan.rb
235
235
  - lib/fastlane/plugin/stream_actions/actions/build_app_for_ios_simulator.rb
236
236
  - lib/fastlane/plugin/stream_actions/actions/check_unsafe_flags.rb
237
+ - lib/fastlane/plugin/stream_actions/actions/core_version.rb
237
238
  - lib/fastlane/plugin/stream_actions/actions/current_branch.rb
238
239
  - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
239
240
  - lib/fastlane/plugin/stream_actions/actions/git_status.rb