Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enables github webhooks #518

Merged
merged 1 commit into from
Feb 16, 2025
Merged

feat: enables github webhooks #518

merged 1 commit into from
Feb 16, 2025

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 codegen-team and a team as code owners February 16, 2025 08:41
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
Copy link

🎉 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.

3 participants