Linkify URLs in Actions workflow logs#36986
Merged
Merged
Conversation
Detect URLs in Actions log output and render them as clickable links, similar to how GitHub Actions handles this. URLs are detected after ANSI-to-HTML conversion and wrapped in anchor tags that open in a new tab. Link color uses a new --color-console-link CSS variable that overrides any ANSI colors and provides sufficient contrast on both light and dark themes. Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
lunny
reviewed
Mar 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds URL detection and “linkification” to the rendered GitHub Actions job log output, so plain URLs in ANSI-rendered log lines become clickable links in the UI.
Changes:
- Add a
linkifyURLs()utility to convert detectedhttp(s)://...substrings into<a>tags while preserving existing ANSI-generated HTML tags. - Apply URL linkification to
renderAnsi()output so Actions logs automatically render clickable URLs. - Add styling for links in Actions logs and introduce a console link theme variable, plus unit tests for the new behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/utils/url.ts | Introduces URL linkification logic for ANSI-rendered HTML strings. |
| web_src/js/utils/url.test.ts | Adds unit tests covering URL linkification cases and HTML-tag-preservation. |
| web_src/js/render/ansi.ts | Runs linkifyURLs() on ANSI-to-HTML rendered output. |
| web_src/js/render/ansi.test.ts | Adds tests verifying URLs become clickable links after ANSI rendering. |
| web_src/js/components/ActionRunJobView.vue | Styles links inside job step logs using a console-themed link color. |
| web_src/css/themes/theme-gitea-light.css | Adds --color-console-link for light theme. |
| web_src/css/themes/theme-gitea-dark.css | Adds --color-console-link for dark theme. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use simpler URL regex that also matches localhost and dotless hosts. Use case-insensitive regex test for the fast-path guard. Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
Not worth the extra code path now that it's a regex test instead of a simple includes() call. Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
The html helper was doing no escaping since both values were htmlRaw. Use direct string concatenation instead for less overhead. Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
silverwind
commented
Mar 25, 2026
Signed-off-by: silverwind <me@silverwind.io>
Track whether we are inside an existing <a> tag and skip URL linkification there to prevent invalid nested anchor elements. Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
Modern browsers imply noopener for target="_blank" and the rest of the codebase does not use it. Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
silverwind
commented
Mar 26, 2026
Signed-off-by: silverwind <me@silverwind.io>
lunny
approved these changes
Mar 26, 2026
Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
silverwind
commented
Mar 26, 2026
Signed-off-by: silverwind <me@silverwind.io>
Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
wxiaoguang
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect URLs in Actions log output and render them as clickable links, similar to how GitHub Actions handles this. Pre-existing links from ansi_up's OSC 8 parsing are also kept intact.