Is it possible to indicate that a workflow has failed while being non-blocking? #200146
Replies: 2 comments
-
|
Yes, you can keep the workflow non-blocking while still making the failure visible. One common approach is to let the visual regression step fail normally, but prevent the whole job from blocking the PR using Example: - name: Run visual regression tests
id: visual_tests
continue-on-error: true
run: npm run test:visual
- name: Add warning summary
if: steps.visual_tests.outcome == 'failure'
run: |
echo "## ⚠️ Visual regression tests failed" >> $GITHUB_STEP_SUMMARY
echo "Please review the visual test results before merging." >> $GITHUB_STEP_SUMMARYIf you want a red X specifically, that usually means the check is failing and may block merging depending on branch protection rules. So the cleaner option is to keep it non-blocking and add a clear PR comment or GitHub job summary when the visual regression test fails. |
Beta Was this translation helpful? Give feedback.
-
|
create a separate workflow/job dedicated to visual regression tests and mark it as non-required in your branch protection rules. The check will fail, but it won’t prevent merging because GitHub isn’t enforcing it as a required status check. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Workflow Configuration
Discussion Details
Hello! Whenever a PR is opened/updated, I have an automated visual regression test workflow that runs. It is a non-blocking workflow in that you can still merge the PR if the viz regression test fails. This is intentional because some changes to the code are intended to update UI. HOWEVER, this being the case, it very silently fails. The entire build check it's in still gets marked off as successful, and so the PR author has to remember to navigate to the viz regression test suite to look at the results. There is no indication that those tests failed. Is it there anyway to configure a Github action that indicates a test failure but is non-blocking so that PR authors can be easily made aware of the failure? I know you can configure a bot to leave a PR comment indicating the failure but I'm wondering if there is another way to indicate this, i.e. a red x on the check. Any help appreciated!
Beta Was this translation helpful? Give feedback.
All reactions