octomachinery: the octobots engine#
How-to create a GitHub Bot tutorial is ready for preview @ tutorial.octomachinery.dev
Elevator pitch#
Hereβs how you π a just-created comment:
from octomachinery.app.server.runner import run as run_app
from octomachinery.routing import process_event_actions
from octomachinery.routing.decorators import process_webhook_payload
from octomachinery.runtime.context import RUNTIME_CONTEXT
@process_event_actions('issue_comment', {'created'})
@process_webhook_payload
async def on_comment(
*,
action, issue, comment,
repository=None, sender=None,
installation=None,
assignee=None, changes=None,
):
github_api = RUNTIME_CONTEXT.app_installation_client
comment_reactions_api_url = f'{comment["url"]}/reactions'
await github_api.post(
comment_reactions_api_url,
preview_api_version='squirrel-girl',
data={'content': '+1'},
)
run_app(
name='Thumbs-Up-Bot',
version='1.0.0',
url='https://github.com/apps/thuuuuuuuuuuuuuumbs-uuuuuuuuuuuup',
)
Prerequisites#
Python 3.7+
Contribute octomachinery#
Want to add something to upstream? Feel free to submit a PR or file an issue if unsure. Note that PR is more likely to be accepted if it includes tests and detailed description helping maintainers to understand it better π
Oh, and be pythonic, please π
Donβt know how? Check out How to Contribute to Open Source article by GitHub π
License#
The source code and the documentation in this project are released under the GPL v3 license.
For Enterprise#
octomachinery is available as part of the Tidelift Subscription.
The octomachinery maintainers and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.