-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
post-add-objects-hook.py
25 lines (20 loc) · 1.04 KB
/
post-add-objects-hook.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# *******************************************************************************
# Copyright (c) 2024 Eclipse Foundation and others.
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License 2.0
# which is available at http://www.eclipse.org/legal/epl-v20.html
# SPDX-License-Identifier: EPL-2.0
# *******************************************************************************
# some EF specific hooks when applying changes:
from otterdog.models.repository import Repository
added_repo_names = []
for patch in patches:
if isinstance(patch.expected_object, Repository):
added_repo_names.append(patch.expected_object.name)
if len(added_repo_names) > 0:
message = "The following GitHub repos have been created:\n"
for repo_name in added_repo_names:
message += f"- https://github.com/{org_config.github_id}/{repo_name}\n"
message += "\nCommitters will gain access to it once the sync script runs (~2h)."
self.printer.println()
self.printer.print_warn(message)