Skip to content

Commit

Permalink
github pusher
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Dec 11, 2024
1 parent 3e1ed61 commit 5dc83d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hasadna_k8s/github_pusher/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ def main():
def run(event_json, file, env):
from . import main
if file:
print(f'Reading event from file: {event_json}')
with open(event_json) as f:
event_json = f.read()
elif env:
print(f'Reading event from env: {event_json}')
event_json = os.environ[event_json]
else:
print('Reading event from argument')
main.run(json.loads(event_json))
print("OK")

Expand Down
1 change: 1 addition & 0 deletions hasadna_k8s/github_pusher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def process(repository_name, repository_organization, ref, files, commit_context
with open(GITHUB_PUSHER_CONFIG_YAML_PATH) as f:
data = benedict(f.read(), format='yaml', keypath_separator=None)
configs = [parse_config(config) for config in data['configs']]
print(f'process {repository_organization}/{repository_name} {ref} ({",".join(files)}) {commit_context}')
if ref.startswith('refs/heads/') and files:
branch = ref.replace('refs/heads/', '')
for config in configs:
Expand Down

0 comments on commit 5dc83d2

Please sign in to comment.