firespring_dev_commands 2.1.37.pre.alpha.1 → 2.1.37.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6c60886c07fe06093181d816b979f07cd1bcb55b14d6b86ef586c8fbc65fc43
|
4
|
+
data.tar.gz: 41c394de5005718cc264b6bc12dda1bf7a1ce5edf6e764b3dc516675e7297ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d709361a1f3cfff3889f2437884aaae55014a8790bc9a17ca9a8fe1c7a7c3070dd3a47dc18879f83e04a726e18ce7ef55eee2f76edb0ccf5e4a7b33ec617b98e
|
7
|
+
data.tar.gz: 21768f2ed5b1333839e8caa356d77bd7cccf30861eeba840f50d7493d511d033aa21fbfc05dafc48443883815584776d9c1a95e55a721722dec91932aff1cea6
|
@@ -425,10 +425,7 @@ module Dev
|
|
425
425
|
g.fetch('origin', prune: true)
|
426
426
|
end
|
427
427
|
|
428
|
-
def commit_status(repository:, branch:, status:, organization: 'firespring', options: {})
|
429
|
-
token = ENV['GITHUB_TOKEN'].to_s.strip
|
430
|
-
raise 'GITHUB_TOKEN is required' unless token
|
431
|
-
|
428
|
+
def commit_status(token:, repository:, branch:, status:, organization: 'firespring', options: {})
|
432
429
|
# Set up the GitHub client
|
433
430
|
client = Octokit::Client.new(access_token: token)
|
434
431
|
|
@@ -160,48 +160,57 @@ module Dev
|
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
+
# rubocop:disable Metrics/MethodLength
|
163
164
|
# Create the rake task for the git commit status task.
|
164
165
|
def create_commit_status_task!
|
165
166
|
# Have to set a local variable to be accessible inside of the instance_eval block
|
166
167
|
exclude = @exclude
|
167
|
-
|
168
168
|
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
169
169
|
namespace :git do
|
170
170
|
return if exclude.include?(:commit_status)
|
171
171
|
|
172
|
-
|
173
|
-
|
174
|
-
"\n\tuse
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
172
|
+
desc 'Add status to PR' \
|
173
|
+
"\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
|
174
|
+
"\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
|
175
|
+
"\n\tuse BRANCH=abc123 to specify the branch of code (required)" \
|
176
|
+
"\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
|
177
|
+
"\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
|
178
|
+
|
179
|
+
# Key Values
|
180
|
+
token = ENV['GITHUB_TOKEN'].to_s.strip
|
181
|
+
repository = ENV['REPOSITORY'].to_s.strip
|
182
|
+
branch = ENV['BRANCH'].to_s.strip
|
183
|
+
|
184
|
+
raise 'GITHUB_TOKEN is required' unless token
|
185
|
+
raise 'Repository name is required' unless repository
|
186
|
+
raise 'Branch name is required' unless branch
|
187
|
+
|
188
|
+
options = {}
|
189
|
+
options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
|
190
|
+
options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
|
191
|
+
|
192
|
+
namespace :commit_status do
|
193
|
+
desc 'Add status success'
|
194
|
+
task :success do
|
195
|
+
Dev::Git.new.commit_status(token:, repository:, branch:, status: 'success', options:)
|
196
|
+
end
|
197
|
+
desc 'Add status pending'
|
198
|
+
task :pending do
|
199
|
+
Dev::Git.new.commit_status(token:, repository:, branch:, status: 'pending', options:)
|
200
|
+
end
|
201
|
+
desc 'Add status error'
|
202
|
+
task :error do
|
203
|
+
Dev::Git.new.commit_status(token:, repository:, branch:, status: 'error', options:)
|
204
|
+
end
|
205
|
+
desc 'Add status failure'
|
206
|
+
task :failure do
|
207
|
+
Dev::Git.new.commit_status(token:, repository:, branch:, status: 'failure', options:)
|
208
|
+
end
|
201
209
|
end
|
202
210
|
end
|
203
211
|
end
|
204
212
|
end
|
213
|
+
# rubocop:enable Metrics/MethodLength
|
205
214
|
end
|
206
215
|
end
|
207
216
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.37.pre.alpha.
|
4
|
+
version: 2.1.37.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|