Open popey opened 3 months ago
I'm not sure how easy it'd be to integrate this into the action directly. I'm not sure how stable they treat the API for creating artifacts.
It is fairly easy to do this in your own workflow by adding a step like the following:
- if: failure()
uses: action/upload-artifact@v4
with:
name: snapcraft-logs
path: ~/.local/state/snapcraft/log/*.log
This will trigger if any previous step in the job has failed. You could leave out the if: failure()
predicate if you always want to create a logs artifact rather than only in the case of failures.
It seems worthwhile updating the example workflow to include something like this.
When a build fails there's no way to get at the log produced by snapcraft. This is especially frustrating when snapcraft itself doesn't produce a useful error in the summary.
Example: https://github.com/popey/twinejs-snap/actions/runs/10046772545/job/27766984335
In the above example, there's no detail about why the final step of creating the package has failed (that's a snapcraft bug, granted), but when this happens, it would be useful to have access to the full log, as I can't login to the runner to get to it manually.
Thanks!