Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github(summary): use relative path for artifact link and fix filename #368

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Jun 17, 2024

fixes #367

Use relative path for artifact link to avoid broken links.

Summary example from integration tests: https://github.com/docker/actions-toolkit/actions/runs/9554693648#summary-26336341867

Artifact link: https://github.com/docker/actions-toolkit/actions/runs/9554693648/artifacts/1610289579

Raw output: https://github.com/docker/actions-toolkit/actions/runs/9554693648/jobs/19145276140/summary_raw

<p>:arrow_down: <a href="./9554693648/artifacts/1610289579"><strong>docker~actions-toolkit~WZAZKH.dockerbuild</strong></a> (5.87 KB)<br>

Added extra commit to convert .dockerbuild filename and build name in the summary to unicode entities.

Has been tested on a private repo where a secret value is part of the .dockerbuild filename:

image

In this case test-docker-action is used as secret value. Here is the raw output of the summary:

<h1>Docker Build summary</h1>
<p>For a detailed look at the build, download the following build record archive and import it into Docker Desktop's Builds view. <br>
Build records include details such as timing, dependencies, results, logs, traces, and other information about a build. <a href="https://docs.docker.com/go/build-summary/">Learn more</a></p><p>:arrow_down: <a href="./9562653800/artifacts/1612120571"><strong>&#x64;&#x6f;&#x63;&#x6b;&#x65;&#x72;&#x7e;&#x74;&#x65;&#x73;&#x74;&#x2d;&#x64;&#x6f;&#x63;&#x6b;&#x65;&#x72;&#x2d;&#x61;&#x63;&#x74;&#x69;&#x6f;&#x6e;&#x7e;&#x31;&#x31;&#x53;&#x55;&#x44;&#x31;&#x2e;&#x64;&#x6f;&#x63;&#x6b;&#x65;&#x72;&#x62;&#x75;&#x69;&#x6c;&#x64;</strong></a> (5.44 KB)<br>
This file includes <strong>1 build record</strong>.</p><p>Find this useful? <a href="https://docs.docker.com/feedback/gha-build-summary">Let us know</a></p><h2>Preview</h2>
<table><tr><th>ID</th><th>Name</th><th>Status</th><th>Cached</th><th>Duration</th></tr><tr><td><code>11SUD1</code></td><td><strong>***/summary.Dockerfile</strong></td><td>:white_check_mark: completed</td><td>0%</td><td>1s</td></tr></table>
<h2>Build inputs</h2>
<pre lang="yaml"><code>context: .
file: summary.Dockerfile
labels:
  - org.opencontainers.image.created=2024-06-18T09:36:08.344Z
  - org.opencontainers.image.description=Test "Docker" Actions
  - org.opencontainers.image.licenses=MIT
  - org.opencontainers.image.revision=63f278762688d23ac87122484821e20de9bc625b
  - org.opencontainers.image.source=https://github.com/docker/***
  - org.opencontainers.image.title=***
  - org.opencontainers.image.url=https://github.com/docker/***
  - org.opencontainers.image.version=master
tags:
  - master
</code></pre>
<hr>

@crazy-max crazy-max force-pushed the summary-artifact-relative-link branch 12 times, most recently from 7699014 to 4ed6ff4 Compare June 17, 2024 21:13
@crazy-max crazy-max marked this pull request as ready for review June 17, 2024 21:24
@@ -149,6 +149,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CTN_BUILDER_NAME: ${{ steps.builder.outputs.name }}
TEST_FOR_SUMMARY: ${{ secrets.TEST_FOR_SUMMARY }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dummy secret is used for testing the behavior of a user having repo name as secret value.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the summary-artifact-relative-link branch 2 times, most recently from b18d6c1 to e8efdb8 Compare June 18, 2024 09:50
@crazy-max crazy-max changed the title github(summary): use relative path for artifact link github(summary): use relative path for artifact link and fix filename Jun 18, 2024
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the summary-artifact-relative-link branch from e8efdb8 to edcf239 Compare June 18, 2024 10:10
@crazy-max crazy-max merged commit 6c6fdff into docker:main Jun 18, 2024
44 checks passed
@crazy-max crazy-max deleted the summary-artifact-relative-link branch June 18, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

summary: .dockerbuild link broken
1 participant