Skip to content

Conversation

@jayhack
Copy link
Contributor

@jayhack jayhack commented Feb 16, 2025

Adds Github webhook types and enables this syntax:

app = CodegenApp(name="github", image=base_image, modal_api_key="")


@app.github.event("pull_request:opened")
def handle_mention(event: PullRequestOpenedEvent):
    logger.info("[PULL_REQUEST:OPENED] Received pull request opened event")
    logger.info(f"PR #{event.number} opened: {event.pull_request.title}")
    logger.info(f"By user: {event.sender.login}")


@app.github.event("pull_request:labeled")
def handle_labeled(event: PullRequestLabeledEvent):
    logger.info("[PULL_REQUEST:LABELED] Received pull request labeled event")
    logger.info(f"PR #{event.number} labeled with: {event.label.name}")
    logger.info(f"PR title: {event.pull_request.title}")


@app.github.event("push")
def handle_push(event: PushEvent):
    logger.info("[PUSH] Received push event")
    logger.info(f"login: {event.sender.login}")
    logger.info(f"repo: {event.repository.name}")
    ```

@jayhack jayhack requested review from a team and codegen-team as code owners February 16, 2025 08:41
@codecov
Copy link

codecov bot commented Feb 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files

@codegen-team codegen-team changed the title Enables Github webhooks feat: enables github webhooks Feb 16, 2025
@jayhack jayhack merged commit ac83142 into develop Feb 16, 2025
25 of 26 checks passed
@jayhack jayhack deleted the jay/add-github-webhooks branch February 16, 2025 09:05
@github-actions
Copy link
Contributor

🎉 This PR is included in version 0.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

rushilpatel0 pushed a commit that referenced this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants