0

I'm trying to compile all my C projects within an Action on GitHub.

This is the command I'm running:

\! find . -name Makefile -type f -execdir make re \; 2>&1 | grep -qF 'Error 1'

It exits 1 if grep finds 'Error 1', which is what make displays when it fails. Locally it works fine, and I've even pulled a fresh branch to make sure it wasn't some local changes which caused a biased result. But nothing...

This is what is displayed in my pipeline:

2023-02-21T13:45:13.6257013Z ##[group]Run \! find . -name Makefile -type f -execdir make re \; 2>&1 | grep -qF 'Error 1'
2023-02-21T13:45:13.6257510Z [36;1m\! find . -name Makefile -type f -execdir make re \; 2>&1 | grep -qF 'Error 1'[0m
2023-02-21T13:45:13.6313689Z shell: /usr/bin/bash -e {0}
2023-02-21T13:45:13.6313965Z ##[endgroup]
2023-02-21T13:45:13.6506466Z ##[error]Process completed with exit code 1.

I've also tried putting the script into a build.sh file, but I get a grep: conflicting matchers specified warning, and no error (even if make error is forced)

Tests I've performed:


If there's a better alternative to the command I'm using, which compiles all Makefiles in immediate subdirectories, that would be great too! :)

Herbie Vine
  • 1,643
  • 3
  • 17
  • 32
  • How did you test locally? And, did you print the exit code with `echo $?` after it's finished? – Azeem Feb 21 '23 at 15:26
  • see if this helps: https://stackoverflow.com/questions/73066461/github-actions-why-an-intermediate-command-failure-in-shell-script-would-cause/73069669#73069669 – pynexj Feb 21 '23 at 15:59
  • What is the `\!`? Why is it there? – jordanm Feb 21 '23 at 16:10

0 Answers0