Argus screenshot bot is a GitHub App built with Probot that helps teams catch unintended visual changes by posting screenshot comparisons as comments on pull requests.
It monitors test workflows that generate screenshot artifacts, downloads visual diffs, and attaches them in a comment on the pull request.
Why "Argus"? Argus is a many-eyed "all-seeing" giant in Greek mythology.
This character is known for having generated the saying "the eyes of Argus"
(being subject to strict scrutiny in one's actions to an invasive, distressing degree).
(c) Wikipedia
Read more about this tool in the article:
«Bots should work, developers should think»: Writing Github App with Node.js.
Deployment of the bot using GitHub actions is the preferred approach.
Deployment as a GitHub app is supported as well.
# .github/workflows/screenshot-bot.yml
on:
workflow_run:
workflows: [E2E Results] # <-- Choose any workflows to be watched by bot
types: [requested, completed]
branches-ignore:
- 'main'
- 'release/**'
pull_request:
types: [closed]
jobs:
awake-screenshot-bot:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
pull-requests: write
steps:
- uses: taiga-family/argus@main
env:
GITHUB_TOKEN: $
You can deploy your own Github App using this code and recipes from the Probot documentation
or use an already hosted screenshot‑report‑bot
The bot has configurable parameters which can be unique for every GitHub repository.
Every parameter is optional, and you can skip this section if the default configuration satisfies your needs.
In order to pass custom parameters to the bot, you should create a screenshot-bot.config.yml
file inside the .github
directory of your repository.
Example of a screenshot-bot.config.yml
file's contents (you can paste it as it is) with default values for each param:
# 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
diff-paths: [
# it is default Cypress folder name into which snapshot diffs are put
'.*__diff_output__.*',
]
# array of attributes (key="value") for html-tag <img /> (screenshots)
# e.g. ['width="200px"', 'height="300px"']
img-attrs: []
# Text which is placed at the beginning of section "Failed tests"
failed-report-description: ''
# Regular expression string to match images inside artifacts (by their path or file name)
# which are created by new screenshot tests.
new-screenshot-mark: '.*==new==.*'
##################################
# Not relevant for GitHub Action #
##################################
# array of regular expression strings to match workflow names
# which should be watched by bot
workflows: [
# all workflows with sub-string "screenshot" in their names
'.*screenshot.*',
]
# array of RegExp strings to match branch names which should be skipped by bot
branches-ignore: []
If you use the bot as a GitHub Action, it is required to provide the permissions
property in your yml
file.
If you use the bot as a GitHub App, it will ask for some permissions at the beginning of the bot's installation.
All requested permissions are necessary, and we do not ask for more permissions than needed.
Bot requires the following repository's permissions:
actions: read
- to get the list of workflow run artifacts and download those artifacts.contents: write
- to create a new branch for the storage of screenshot diffs imagesmetadata: read
- mandatory for Github App.pull_requests: write
- to create/edit PR's comment with bot's tests reports.The bot listens to the following repository events:
pull_request
— bot listens to the pull request.closed
event in order to delete all saved screenshots for the closed PR.workflow_run
— bot listens to the workflow_run.completed
event in order to download artifacts and send tests report as PR comment.