Workflow Artifact Info Hover (#37100)

Add expiry metadata to action artifacts in the run view and show it on hover.

---------

Signed-off-by: Nicolas <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Nicolas
2026-04-19 09:37:50 +02:00
committed by GitHub
parent 0bc2a2836f
commit 16bdae53c8
16 changed files with 157 additions and 30 deletions
+12 -1
View File
@@ -1,5 +1,5 @@
import {
dirname, basename, extname, isObject, stripTags, parseIssueHref,
dirname, basename, extname, formatBytes, isObject, stripTags, parseIssueHref,
translateMonth, translateDay, blobToDataURI,
toAbsoluteUrl, encodeURLEncodedBase64, decodeURLEncodedBase64, isImageFile, isVideoFile, parseRepoOwnerPathInfo,
urlQueryEscape,
@@ -122,6 +122,17 @@ test('encodeURLEncodedBase64, decodeURLEncodedBase64', () => {
expect(new Uint8Array(decodeURLEncodedBase64('YQ=='))).toEqual(uint8array('a'));
});
test('formatBytes', () => {
expect(formatBytes(-1)).toBe('0 B');
expect(formatBytes(0)).toBe('0 B');
expect(formatBytes(512)).toBe('512 B');
expect(formatBytes(1024)).toBe('1.0 KiB');
expect(formatBytes(1536)).toBe('1.5 KiB');
expect(formatBytes(10 * 1024)).toBe('10 KiB');
expect(formatBytes(1024 * 1024)).toBe('1.0 MiB');
expect(formatBytes(1024 * 1024 * 1024)).toBe('1.0 GiB');
});
test('file detection', () => {
for (const name of ['a.avif', 'a.jpg', '/a.jpeg', '.file.png', '.webp', 'file.svg']) {
expect(isImageFile({name})).toBeTruthy();