Skip to content

Instantly share code, notes, and snippets.

@ddoice
Last active September 27, 2022 09:51
Show Gist options
  • Save ddoice/9ffdf1dd703fecaa29aa97dedd93fe84 to your computer and use it in GitHub Desktop.
Save ddoice/9ffdf1dd703fecaa29aa97dedd93fe84 to your computer and use it in GitHub Desktop.
Turborepo github actions reporter fix

vercel/turborepo#1363

Not perfect but in the meantime this small script can be used to wrap Jest and Playwright scripts and capture these errors to later remove the package + task prefix.

#!/bin/bash
$@ |& tee output.txt
cat output.txt | grep " ::error " | sed -e "s/^.*:.*:\s::error/::error/"
failed=$(cat output.txt | grep " ::error " | wc -l)

if [ $failed -gt "0" ]
then
  exit 1
fi
exit 0

Then change your jobs steps, Ie:

# - run: yarn run e2e
- run: >
    bash -e ./.github/error_trap.sh
    yarn run e2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment