Post a image on the pull request. Usefull for screenshots of failed E2E tests. Also supports tagging code files.
If you encounter the "Resource not accessible by integration" you need to add the following permissions:
permissions:
contents: write
actions: read
checks: write
The github token to perform api actions, can be set to
${{GITHUB_TOKEN}}
or a custom one.
The path to the image files, it supports glob.
(Ex: ./my-image/**/*.png)
The title to display on the annotations
(Ex: Failed E2E Tests)
Where to upload the pictures to
(Default: https://litterbox.catbox.moe/resources/internals/api.php , please do not upload sensitive information, this is public access)
, uses form POST to upload.
The tag that is used to split the base64 image info
(Default: [==] Ex: tests/mytest.spec.js[--]80:40.png)
The annotation level | Supported values: notice, warning, failure
(Default: notice)
- name: Upload failed tests
if: ${{ failure() }}
uses: edunad/[email protected]
with:
path: './failed_tests/**/*.png'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: 'Failed E2E tests 🙀'
annotationLevel: 'failure'
Save your image name with following format and convert it to base64
filePath[==]line:column
tests/mycode/basic-test.spec.js[==]80:30
Then on NodeJS save the image as
const fs = require('fs');
const imageName = Buffer.from(`tests/mycode/basic-test.spec.js[==]80:30`).toString('base64');
fs.writeFileSync(`${imageName}.png`, ...etc)