Detect if the job failed in the post action
Closed this issue · 3 comments
This is a tracking issue.
We use a 'wrapping action', which means we can always execute a bit of code when the job finishes. We use this post action for building and transmitting the final trace (i.e. buildevents build
).
Unfortunately, it's not possible to detect in this section whether the build failed or not.
The current workaround is to check for an environment variable BUILD_SUCCESS
. The user of gha-buildevents
is responsible for setting this variable as last step in the build, which is not ideal.
Asked on the community forum: https://github.community/t5/GitHub-Actions/Determine-if-job-failed-in-wrapper-action/m-p/55870
Tried to detect failure by using the GitHub API. Using the Get a workflow job API.
Conclusion: still not sufficient information.
The response contains a status
fields that will typically be set to in_progress
during the workflow and a conclusion
which is still set to null at this point.