INNER CODE UNIT · Python

PartialGithubEvent

layer5io/layer5 · .github/actions/comment-preview-on-pr/app/main.py:30

class PartialGithubEvent(BaseModel):
    workflow_run: PartialGithubEventWorkflowRun


if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)
    settings = Settings()
    logging.info(f"Using config: {settings.json()}")
    g = Github(settings.input_token.get_secret_value())
    repo = g.get_repo(settings.github_repository)
    try:
        event = PartialGithubEvent.parse_file(settings.github_event_path)
    except ValidationError as e:
        logging.error(f"Error parsing event file: {e.errors()}")
        sys.exit(0)
    use_pr: Optional[PullRequest] = None
    for pr in repo.get_pulls():
        if pr.head.sha == event.workflow_run.head_commit.id:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…