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 bd54c48 commit dfbd771
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hasadna_k8s/github_pusher/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ def main():

@main.command()
@click.argument('EVENT_JSON')
def run(event_json):
@click.option('--file', is_flag=True)
@click.option('--env', is_flag=True)
def run(event_json, file, env):
from . import main
if os.path.exists(event_json):
if file:
with open(event_json) as f:
event_json = f.read()
elif env:
event_json = os.environ[event_json]
main.run(json.loads(event_json))
print("OK")

Expand Down

0 comments on commit dfbd771

Please sign in to comment.