From 38c8d187d214fc2c4987bf4bd60819a615c9d9d5 Mon Sep 17 00:00:00 2001 From: Ori Kotek Date: Thu, 13 Jul 2023 18:16:25 +0300 Subject: [PATCH] Github custom action development - WIP --- .github/workflows/review.yaml | 2 +- pr_agent/servers/github_action_runner.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/review.yaml b/.github/workflows/review.yaml index 93ad8040..91a49c07 100644 --- a/.github/workflows/review.yaml +++ b/.github/workflows/review.yaml @@ -1,4 +1,4 @@ -on: [push] +on: [push, pull_request] jobs: pr_agent_job: diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index 7589b2f5..6b9141bf 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -16,17 +16,20 @@ def run_action(): if not GITHUB_REPOSITORY: print("GITHUB_REPOSITORY not set") return - print(event_payload) - print(GITHUB_REPOSITORY) - print(GITHUB_EVENT_NAME) - print(GITHUB_EVENT_PATH) - print("Hello from run_action") RUNNER_DEBUG = os.environ.get('RUNNER_DEBUG', None) if not RUNNER_DEBUG: print("RUNNER_DEBUG not set") return + ### DEBUG + print(event_payload) + print(GITHUB_REPOSITORY) + print(GITHUB_EVENT_NAME) + print(GITHUB_EVENT_PATH) print(RUNNER_DEBUG) + if GITHUB_EVENT_NAME == "pull_request": + print("PR event") + if __name__ == '__main__': run_action()