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: 00bcbaf914067d7b8f992dc30dd42dcbbb0c0a5c316ddbb66eec5b380c24f8b0
4
- data.tar.gz: 7e99f410b57240a7172c792ed47bc1859275c95048ea9858f7813a05dc0aae75
3
+ metadata.gz: 02b1103d943cdd43f0dfb44573438a207e4b6ed15d249f7d479cb551dcf45c27
4
+ data.tar.gz: 7f69ba10e27773de913fe774b11cb89f643ee45b90145eb6ae5071176f2ee0f3
5
5
  SHA512:
6
- metadata.gz: a74d41c1a171401e0c3ec2ce599e2d179df7b4b5f3e08dcdb58d3665d9132cdddc2c12e2d3f75ae92ed73495ac65e4b1cd1ed376254c9a4e2ab273d0510d8fd1
7
- data.tar.gz: e2c0a2c8ea26d91b9a8ded086c0f996922b5376c48466446d222a16c216a0d01162e855d746090b97d2eb5328712197db2427cd1d6b00399e39a89a2e246ebd1
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
- v1 = Gem::Version.new(interpolated['version'].gsub(/^v/i, ''))
265
- v2 = Gem::Version.new(current_version.to_s.split.last.gsub(/^v/i, ''))
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']} #{interpolated['version']}")
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.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: 2023-12-20 00:00:00.000000000 Z
11
+ date: 2024-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler