Skip to content

lumberjack-bot

GitHub App

lumberjack-bot

GitHub App

Source code of the bot – Github repo.

Setup πŸš€

You can deploy your own bot using this code
or use already hosted lumberjack-bot.

We actively use lumberjack-bot in our UI Kit library Taiga UI.
It watches our taiga-components, and it can keep track of your repository too.
Do not hesitate to integrate it in your project's development.

To begin using bot:

Bot configurations βš™οΈ

Bot has configurable params which can be unique for every Github repository.

Every param is optional, and you can skip this section if default configuration satisfies you.

To pass custom params for bot you should create screenshot-bot.config.toml file inside the .github directory of repository.

Example of screenshot-bot.config.toml file content (you can paste it as it is) and default values of each param:

# array of regular expression strings to match workflow names
# which should be watched by bot
workflowWithTests = [
  '.*screenshot.*', # all workflows with sub-string "screenshot" in their names
]

# array of RegExp strings to match images inside artifacts (by their path or file name)
# which shows difference between two screenshot and which will be added to bot report comment
screenshotsDiffsPaths = [
  '.*__diff_output__.*', # it is default cypress folder name into which snapshot diffs are put
]

# Regular expression string to match images inside artifacts (by their path or file name)
# which are created by new screenshot tests.
newScreenshotMark = '.*==new==.*'

# array of RegExp strings to match branch names which should be skipped by bot
branchesIgnore = []

What bot can do? πŸ’‘

  • Holds first PR comment.
    All workflow updates edit already existing bot comment.
    No endless stream of comments from bot!
  • Sets loading state comment when PR is opened or new commits are pushed to PR.
    loading-demo
  • Downloads artifacts from workflow with tests, finds screenshots diffs images, and pins them to the tests failure report.
    error-report-demo
  • Removes all uploaded images (for current PR) after closing pull request.
    closed-pr-demo

About Permissions πŸ”

At the beginning of the bot's installation it asks for some permissions.

All of them are really needed, and we do not ask for more permissions than necessary.

Permissions

Bot requires the following repository's permissions:

  • actions: read - to get list of workflow run artifacts and download these artifacts.
  • contents: write - to create new branch for storage of screenshot diffs images
    and to ability to upload/delete these screenshot diffs images.
  • metadata: read - mandatory for Github App.
  • pull_requests: write - to create/edit PR's comment with bot's tests reports.

Events

Bot listens to the following repository's events:

  • pull_request β€” bot listens to pull request closing to delete all saved screenshots for current closed PR.
  • workflow_run β€” bot listens to workflow completion to download artifacts and send tests report as PR comment.

Developer

lumberjack-bot is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

Report abuse