I have a github action to catch when a build fails:
run-if-failed:
runs-on: macos-11
needs: [ sonar, main ]
if: always() && (needs.sonar.result == 'failure' || needs.main.result == 'failure')
steps:
- if: ${{ failure() }}
run: gh run view --log-failed
- name: Needs context
env:
NEEDS_CONTEXT: ${{ toJSON(needs.main.result) }}
run: echo "::notice file=Error,title=What Went Wrong::$NEEDS_CONTEXT"
however I am unable to truly see what the failure is with $NEEDS_CONTEXT
Is there a way to display the failure logs like it does in actions tab of github?