fastlane-plugin-stream_actions 0.4.4 → 0.4.5

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: c822fdfad8f332a11b18881d8c1a57861942c71e148b6fb4a51720fe28ec5f99
4
- data.tar.gz: 828397123a0ae1995d7c7d4a5cd7cfcbc5b1ad3276e594f265b312aa024a1194
3
+ metadata.gz: 588bc089b57e2d637ed87e062d4f70b47b9ed434a902331ade91e775b97c251d
4
+ data.tar.gz: '09dd367927a51c2976dc9e2bc2a52827b78ff26b9c6e37bacb6bbd66d1ffc23b'
5
5
  SHA512:
6
- metadata.gz: 22683a0374246a7d4c98b7274fe13e7f98aa1649c386fba1f33953d888e7be8e7605838ce122e367a73725a9eb76258bfa6bf7a1f354d28c9fabe6e62b189a02
7
- data.tar.gz: 8dfedadc11a5e46a23674caecb46bf71835793244475aecbde062d4d4993ff87dadb46693150b656da8ae1d0ba13e598f3e69e609aa64ea1ab9c5ee680aa14e8
6
+ metadata.gz: d125f60bb7937c1825928b57c77b02eb49fae737636792b252fb257e882817be3b978003ef2d9aea4b4a0a8c7b57c2062b0b1f94a76bb75c103c0cc0b6a3f60a
7
+ data.tar.gz: 07e0d6184d4e3b363fbb0f4cabbff98dd681e96a96b89f7184f2b5bf5cd9d4a746a0eba382181c1866aa4443f55e3bf3c4cafa01aef3d0df3c3bf90e4251444a
@@ -25,8 +25,8 @@ module Fastlane
25
25
  return false
26
26
  end
27
27
 
28
- # The current push does not touch :sources. It is only safe to skip if the last commit that
29
- # did change :sources had all required checks pass; otherwise :sources were never verified.
28
+ # The current push does not touch :sources. It is only safe to skip if :sources were already
29
+ # verified, i.e. all required checks passed on some commit that has the current :sources tree.
30
30
  is_check_required = self.required_due_to_history(params, required_checks)
31
31
  UI.important("Check is required: #{is_check_required}")
32
32
  is_check_required
@@ -36,8 +36,9 @@ module Fastlane
36
36
  files.any? { |path| sources.any? { |required| path.start_with?(required) } }
37
37
  end
38
38
 
39
- # Walks the PR commits from newest to oldest until the last commit that changed :sources is
40
- # found, then returns whether the check must run based on that commit's required check runs.
39
+ # Walks the PR commits from newest to oldest. Every commit newer than the last :sources change
40
+ # has the current :sources tree, so a passing run on any of them means :sources were verified.
41
+ # The walk stops at the commit that changed :sources, since older commits have different sources.
41
42
  def self.required_due_to_history(params, required_checks)
42
43
  repo = (params[:github_repository] || ENV['GITHUB_REPOSITORY']).to_s
43
44
  if repo.empty?
@@ -51,20 +52,21 @@ module Fastlane
51
52
  return true
52
53
  end
53
54
 
54
- sources_sha = shas.find { |sha| self.touches_sources?(self.commit_files(repo, sha), params[:sources]) }
55
- if sources_sha.nil?
56
- UI.message("No commit in this PR changed sources; nothing to test")
57
- return false
58
- end
55
+ shas.each do |sha|
56
+ short = sha[0, 7]
57
+ if self.required_checks_passed?(repo, sha, required_checks)
58
+ UI.message("Commit #{short} passed required checks for the current sources; safe to skip")
59
+ return false
60
+ end
61
+
62
+ next unless self.touches_sources?(self.commit_files(repo, sha), params[:sources])
59
63
 
60
- short = sources_sha[0, 7]
61
- if self.required_checks_passed?(repo, sources_sha, required_checks)
62
- UI.message("Last sources commit #{short} passed required checks; safe to skip")
63
- false
64
- else
65
- UI.important("Last sources commit #{short} did not pass required checks; running check")
66
- true
64
+ UI.important("Last sources commit #{short} was not verified by a passing run; running check")
65
+ return true
67
66
  end
67
+
68
+ UI.message("No commit in this PR changed sources; nothing to test")
69
+ false
68
70
  end
69
71
 
70
72
  # PR commits, newest first (gh returns them oldest first).
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.4.4'
3
+ VERSION = '0.4.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream