Skip to content

Upload test reports with subresources w/o workarounds #787

@pavelfeldman

Description

@pavelfeldman

What would you like to be added?

I'd like to publish a report with subresources (images). For that I am uploading images and then putting the link to them in my report.

If I use URLs returned from upload-action (https://github.com/pavelfeldman/gha-artifact-test/actions/runs/23565735512/artifacts/6111916575) in <img> tag I get 404.
I can however resolve it using the snippet below to get a Blob URL that is perfectly usable as a subresource.

As such, it does not seem like not serving subresources is a security matter (can be easily worked around in the snippet below), so I'm kindly asking that subresources become embeddable!

Example of not-working and working URLs:

<img src="https://github.com/pavelfeldman/gha-artifact-test/actions/runs/23565735512/artifacts/6111916575"></img>
<img src="https://productionresultssa13.blob.core.windows.net/actions-results/fdfad5ce-0c2c-4eca-bd84-51c3bdd251c9/workflow-job-run-a773be87-33f4-534f-a63d-a928bedd9e97/artifacts/929bb13ca89fe2af0d33882f8ff5ba3973af6d5001f1c3da916c862c78a74f14.png?rscd=inline%3B+filename%3D%22playwright.png%22&rsct=image%2Fpng&se=2026-03-25T22%3A07%3A58Z&sig=PXgEC191CiJ4c8WBb2NXs%2BwGN1HEEbTB6AMYyHx08Bc%3D&ske=2026-03-26T01%3A02%3A48Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2026-03-25T21%3A02%3A48Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2025-11-05&sp=r&spr=https&sr=b&st=2026-03-25T21%3A57%3A53Z&sv=2025-11-05"></img>
- name: Upload image artifact
  id: upload-image
  uses: actions/upload-artifact@v7
  with:
    path: playwright.png
    archive: false

- name: Resolve blob storage URL for image
  id: resolve-url
  run: |
    ARTIFACT_ID="${{ steps.upload-image.outputs.artifact-id }}"
    # The /zip endpoint for unarchived artifacts redirects to the blob storage URL
    BLOB_URL=$(curl -Ls -o /dev/null -w '%{url_effective}' \
      -H "Authorization: Bearer ${{ github.token }}" \
      "${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/${ARTIFACT_ID}/zip")
    echo "Blob URL: $BLOB_URL"
    echo "blob-url=$BLOB_URL" >> "$GITHUB_OUTPUT"

- name: Generate report
  env:
    BLOB_URL: ${{ steps.resolve-url.outputs.blob-url }}
  run: |
    python3 -c "
    import os
    url = os.environ['BLOB_URL']
    with open('report.html') as f:
        html = f.read()
    with open('report-final.html', 'w') as f:
        f.write(html.replace('PLAYWRIGHT_PNG_URL', url))
    "

Why is this needed?

I'd like to be able to upload HTML reports for Playwright tests that link to images (png) and trace files (zips) that I can load as web subresources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions