huginn_github_autocommit_agent 0.1.1 → 0.1.21
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: 02b1103d943cdd43f0dfb44573438a207e4b6ed15d249f7d479cb551dcf45c27
|
4
|
+
data.tar.gz: 7f69ba10e27773de913fe774b11cb89f643ee45b90145eb6ae5071176f2ee0f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff1566f206185924da835dcdcab0e8b2c3f525a522329387e6341cde7ba5bd984edd7eb0db6ff64ff57d9e795ae35d57ca47c43e42acc31e8237540a8bc85535
|
7
|
+
data.tar.gz: 49d89ac4db20f9e40626d5e66a4c45c1851330e58ff38ae5c4ddae660405b6588fb61d383a7b96fca5187b672c1c9b1eadba13e23a7d6600100892ccd91116b2
|
@@ -260,15 +260,18 @@ module Agents
|
|
260
260
|
sha = data['sha']
|
261
261
|
|
262
262
|
file_content = Base64.decode64(file_content_base64)
|
263
|
-
current_version = file_content.match(/^ENV #{to_apply['pattern']}
|
264
|
-
|
265
|
-
|
263
|
+
current_version = file_content.match(/^ENV #{to_apply['pattern']}=(.*)/)[1]
|
264
|
+
if interpolated['debug'] == 'true'
|
265
|
+
log current_version
|
266
|
+
end
|
267
|
+
v1 = Gem::Version.new(interpolated['version'].gsub(/^v/i, '').gsub(/^jenkins-/i, ''))
|
268
|
+
v2 = Gem::Version.new(current_version.to_s.split.last.gsub(/^v/i, '').gsub(/^jenkins-/i, ''))
|
266
269
|
comparison_result = v1 <=> v2
|
267
270
|
|
268
271
|
if comparison_result == 0 || comparison_result == -1
|
269
272
|
log "The current version (#{current_version.to_s.split.last}) is already greater than or equal to the given version (#{interpolated['version']}). No replacement necessary."
|
270
273
|
else
|
271
|
-
file_content.gsub!(/^ENV #{to_apply['pattern']}.*/, "ENV #{to_apply['pattern']}
|
274
|
+
file_content.gsub!(/^ENV #{to_apply['pattern']}.*/, "ENV #{to_apply['pattern']}=#{interpolated['version']}")
|
272
275
|
update_content(to_apply['owner'],to_apply['my_repository'],to_apply['file'],file_content,sha)
|
273
276
|
# log file_content
|
274
277
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_github_autocommit_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Germain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|