peoplegroup-connectors 0.4.5 → 0.4.6

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: 101c7addebf908c56678952ea0a8c665593b1fee3b7e3d00de0c783df03e6e4b
4
- data.tar.gz: 9ef4198e0b4d7913c298b7c38514e7b338dce126e300e4b2f7c7cf81c1515f4a
3
+ metadata.gz: c48bab13ef7b1fe6354e248cca86be60b3459f8e94ff91d1aa393d083b54ded0
4
+ data.tar.gz: e94c28a7ba8af4d8bae0d1c3aa36ab3a4f64c4a635b060d8bf6f940766cf28d0
5
5
  SHA512:
6
- metadata.gz: 66334d66920daa6d41fd660344e97712ea21d879fc5305761eebb0afeb78c5b887544bf18babf2c11ba996f1be1442e508478a3bf8d62d708870e48b164ed230
7
- data.tar.gz: 6ba92c9135aae7e2212795b513d985fb7ecbf4802e6dc848c522627b95c8b7287d38e69c1238d49f359e2303cae26e3c9b6122943ba700ae507b15842c9cd41d
6
+ metadata.gz: 63b0bc61776b56df5abed76a807c92c0a09caef9c494d0e7b56a7ded30275a86a977fa1e0adf70000ae420c96d39cd127460af6169aee48b2f4d3570058bb66c
7
+ data.tar.gz: 3fad927840ea59a5e557ad8d1e3596341506943a5c656845539996b0813f7a498ce2699d816496c2236b2efd8c82606c53364df475c89b3fa882a1cf44cbb53c
@@ -125,6 +125,44 @@ module PeopleGroup
125
125
  create_merge_request(project_id, commit_message, options)
126
126
  end
127
127
 
128
+ def commit_change_to_new_merge_request_v3(project_id, branch_name, commit_message, description, files_to_delete: [], files_to_update: [], files_to_add: [], target_branch: 'master')
129
+ actions = []
130
+
131
+ files_to_delete.each do |file|
132
+ actions << { action: 'delete', file_path: file }
133
+ end
134
+
135
+ files_to_add.each do |file|
136
+ actions << {
137
+ action: 'create',
138
+ file_path: file[:remote_path],
139
+ content: File.read(file[:local_path])
140
+ }
141
+ end
142
+
143
+ files_to_update.each do |file|
144
+ actions << {
145
+ action: 'update',
146
+ file_path: file[:remote_path],
147
+ content: File.read(file[:local_path])
148
+ }
149
+ end
150
+
151
+ return unless actions.any?
152
+
153
+ create_branch(project_id, branch_name, target_branch)
154
+ create_commit(project_id, branch_name, commit_message, actions)
155
+
156
+ options = {
157
+ source_branch: branch_name,
158
+ target_branch: target_branch,
159
+ description: description,
160
+ remove_source_branch: true
161
+ }
162
+
163
+ create_merge_request(project_id, commit_message, options)
164
+ end
165
+
128
166
  def commit_change_to_new_merge_request_v2(project_id, branch_name, commit_message, description = nil, files_to_delete = [], files_to_update = [], target_branch: 'master', assign_group: nil)
129
167
  actions = []
130
168
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PeopleGroup
4
4
  module Connectors
5
- VERSION = '0.4.5'
5
+ VERSION = '0.4.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peoplegroup-connectors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - lien van den steen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-09 00:00:00.000000000 Z
11
+ date: 2023-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab