[fix] Resurrect Log Artifact Logic
The change in !2590 (merged) removed this script, so the failed CI pipelines no longer had logs. This just inlines the logic in the pipeline script.
As of 2024-05-14 a change has been implemented to enforce access token expiry. If you see higher numbers of HTTP 401 responses, please check tokens that may have expired. For more details, including how to mitigate disruption, please check our docs guide on Expired Access Tokens. If you have a support contract, you may open a support ticket for additional assistance.
The change in !2590 (merged) removed this script, so the failed CI pipelines no longer had logs. This just inlines the logic in the pipeline script.