8000 feat(api,cli): add support for changelog generation · python-gitlab/python-gitlab@472add7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 472add7

Browse files
committed
feat(api,cli): add support for changelog generation
1 parent d8b8a0a commit 472add7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

gitlab/v4/objects/repositories.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,25 @@ def delete_merged_branches(self, **kwargs):
204204
"""
205205
path = "/projects/%s/repository/merged_branches" % self.get_id()
206206
self.manager.gitlab.http_delete(path, **kwargs)
207+
208+
@cli.register_custom_action(
209+
"Project",
210+
("version_tag",),
211+
("from", "to", "date", "branch", "trailer", "file", "message"),
212+
)
213+
@exc.on_http_error(exc.GitlabCreateError)
214+
def changelog(self, data=None, **kwargs):
215+
"""Create a changelog entry in the repository.
216+
217+
Args:
218+
**kwargs: Extra options to send to the server (e.g. sudo)
219+
220+
Raises:
221+
GitlabAuthenticationError: If authentication is not correct
222+
GitlabCreateError: If the server failed to perform the request
223+
"""
224+
path = "/projects/%s/repository/changelog" % self.get_id()
225+
226+
# This is here to avoid clashing with the CLI's `--version` flag
227+
228+
self.manager.gitlab.http_post(path, data=data, **kwargs)

0 commit comments

Comments
 (0)
0