mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 05:10:38 +08:00
update pipeline
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import os
|
||||
from pr_agent.agent.pr_agent import PRAgent
|
||||
import os
|
||||
from pr_agent.config_loader import get_settings
|
||||
from pr_agent.tools.pr_reviewer import PRReviewer
|
||||
import asyncio
|
||||
|
||||
@ -8,9 +8,19 @@ async def run_action():
|
||||
pull_request_id = os.environ.get("BITBUCKET_PR_ID", '')
|
||||
slug = os.environ.get("BITBUCKET_REPO_SLUG", '')
|
||||
workspace = os.environ.get("BITBUCKET_WORKSPACE", '')
|
||||
bearer_token = os.environ.get('BITBUCKET_BEARER_TOKEN', None)
|
||||
|
||||
# Check if required environment variables are set
|
||||
if not bearer_token:
|
||||
print("BITBUCKET_BEARER_TOKEN not set")
|
||||
|
||||
# Set the environment variables in the settings
|
||||
get_settings().set("BITBUCKET.BEARER_TOKEN", bearer_token)
|
||||
|
||||
if pull_request_id and slug and workspace:
|
||||
pr_url = f"https://bitbucket.org/{workspace}/{slug}/pull-requests/{pull_request_id}"
|
||||
await PRReviewer(pr_url).run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(run_action())
|
||||
asyncio.run(run_action())
|
||||
|
||||
|
Reference in New Issue
Block a user