fastlane-plugin-approved 0.1.0 → 0.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f6872c458a5f49b5a1c7a835f9909370504f5e7f3a32d0a9329e72f16ae116
|
4
|
+
data.tar.gz: 6a00e2d1f00fb2f99de85d62f03a4dab7de41652047c8940a63ea76f4c8ed9c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8222aa92d8868e3566ed048c584e65c82c6e990bde2bb0d816282f604bafe8c5b78102cb5c8b1d02740753f39b9d38e635575fe3d678d6b980eb9ccba5ffcbbc
|
7
|
+
data.tar.gz: d42c4825dff3154cd14b6532502fa28d5d45930c129c7ddb438e49693936d7f8d5dafe34a5db8a924c44cd99d13e8af00abffc02462c20ab91a86b16fdd534d1
|
@@ -8,9 +8,8 @@ module Fastlane
|
|
8
8
|
require 'pathname'
|
9
9
|
repo_path = Dir.getwd
|
10
10
|
repo_pathname = Pathname.new(repo_path)
|
11
|
-
UI.message("Performing Approved Pre-check!")
|
12
11
|
other_action.approved_precheck
|
13
|
-
|
12
|
+
|
14
13
|
head = Actions.sh("git -C #{repo_path} rev-parse HEAD").strip
|
15
14
|
|
16
15
|
approved_file_path = params[:approval_file_path]
|
@@ -19,15 +18,20 @@ module Fastlane
|
|
19
18
|
File.expand_path(File.join(repo_pathname, approved_file_absolute_path))
|
20
19
|
|
21
20
|
File.open(approved_file_absolute_path, "w") { |f| f.write "#{head}" }
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
|
22
|
+
if params[:no_commit]
|
23
|
+
UI.success("Approved! Your approval file has been updated!")
|
24
|
+
else
|
25
|
+
# then create a commit with a message
|
26
|
+
Actions.sh("git -C #{repo_path} add #{approved_file_absolute_path}")
|
27
|
+
begin
|
28
|
+
commit_message = "Approved commit #{head}"
|
29
|
+
Actions.sh("git -C #{repo_path} commit -m '#{commit_message}'")
|
30
|
+
UI.success("Committed \"#{commit_message}\" 💾.")
|
31
|
+
rescue => ex
|
32
|
+
UI.error(ex)
|
33
|
+
UI.important("Didn't commit any changes.")
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
|
@@ -52,10 +56,16 @@ module Fastlane
|
|
52
56
|
[
|
53
57
|
FastlaneCore::ConfigItem.new(key: :approval_file_path,
|
54
58
|
env_name: "APPROVED_FILE_PATH",
|
55
|
-
description: "Path to
|
56
|
-
optional:
|
59
|
+
description: "Path to approval file",
|
60
|
+
optional: true,
|
57
61
|
type: String,
|
58
|
-
default_value: ".approved")
|
62
|
+
default_value: ".approved"),
|
63
|
+
FastlaneCore::ConfigItem.new(key: :no_commit,
|
64
|
+
env_name: "APPROVED_NO_COMMIT",
|
65
|
+
description: "Update approval file but don't commit",
|
66
|
+
optional: true,
|
67
|
+
type: Boolean,
|
68
|
+
default_value: false)
|
59
69
|
]
|
60
70
|
end
|
61
71
|
|
@@ -7,7 +7,7 @@ module Fastlane
|
|
7
7
|
def self.run(params)
|
8
8
|
repo_path = Dir.getwd
|
9
9
|
repo_pathname = Pathname.new(repo_path)
|
10
|
-
UI.message("
|
10
|
+
UI.message("Performing Approved Pre-check!")
|
11
11
|
git_dirty_files = Actions.sh("git -C #{repo_path} diff --name-only HEAD").split("\n") + Actions.sh("git -C #{repo_path} ls-files --other --exclude-standard").split("\n")
|
12
12
|
|
13
13
|
approved_file_path = params[:approval_file_path]
|
@@ -20,9 +20,9 @@ module Fastlane
|
|
20
20
|
"Found the following uncommitted files:",
|
21
21
|
" #{git_dirty_files.join("\n ")}",
|
22
22
|
]
|
23
|
-
UI.user_error!("#{error.join("\n")}")
|
23
|
+
UI.user_error!("#{error.join("\n")}")
|
24
24
|
end
|
25
|
-
|
25
|
+
UI.message("Good. Approved Pre-check passed!!!")
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.description
|