Skip to content

wallabag/serverless-bot

Repository files navigation

wallabag Serverless Bot

Tests

This serverless project does some stuff to help the wallabag team. It:

  • validates PRs sent to site-config repository: fivefilters & graby
  • automatically label PRs created by Weblate
  • more to come!

image

Use Cases

Available lambdas:

  • extension: It validates each file in the diff has a .txt extension.
  • weblate: It automatically label PRs created by Weblate.
  • siteconfig-email: It handles a email requesting a siteconfig, create a GitHub issue and reply with that issue.

Prerequisites

Setup

Deploy the code

  • Get a new personal access token on GitHub
  • Set it in AWS Parameter Store as a SecureString with name GITHUB_TOKEN
  • Deploy the service using: serverless deploy
  • Enable the rule: aws ses set-active-receipt-rule-set --rule-set-name wallabag-siteconfig-ruleset

By default

  • it'll use the AWS profile default, but you can use your own using (be sure it's defined in your ~/.aws/credentials): serverless deploy --aws-profile myprofile
  • it'll be deployed to the AWS region eu-west-1 but you can change it using: serverless deploy --region us-east-1

Setup GitHub webhook

Configure the webhook in the GitHub repository settings.

  • In the Payload URL, enter the URL you received after deploying. It would be something like https://<your_url>.amazonaws.com/dev/webhook/....
  • Choose the "application/json" in Content type.
  • In the types of events to trigger the webhook, select "Let me select individual events", then select at least Pull Requests.

Some options

You can update some options from the serverless.yml file:

  • NAMESPACE: change the namespace used in the PR check (displayed at the bottom of each PR)

Info

Inspired from 20minutes/serverless-github-check.

About

⚡ A Serverless project that assists the wallabag team with various tasks

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •