Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/screenshots-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ concurrency:

jobs:
cleanup:
# Disabled to avoid breaking images on older PRs. Flip to `true` to re-enable deletion.
if: false
runs-on: ubuntu-latest
Comment thread
vitorvasc marked this conversation as resolved.
steps:
- name: Get otelbot token
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/screenshots-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,26 @@ jobs:
base_url = f"https://raw.githubusercontent.com/{repo}/otelbot/screenshots/{pr_number}"
timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC")

def table(slug):
VIEWPORTS = ("desktop", "tablet", "mobile")

def theme_table(slug, theme):
cells = " | ".join(
f"![{slug} {vp} {theme}]({base_url}/{vp}-{theme}-{slug}.png)"
for vp in VIEWPORTS
)
Comment thread
vitorvasc marked this conversation as resolved.
Comment thread
vitorvasc marked this conversation as resolved.
Comment thread
vitorvasc marked this conversation as resolved.
return (
"| Desktop | Tablet | Mobile |\n"
"|---|---|---|\n"
f"| ![{slug} desktop]({base_url}/desktop-{slug}.png)"
f" | ![{slug} tablet]({base_url}/tablet-{slug}.png)"
f" | ![{slug} mobile]({base_url}/mobile-{slug}.png) |"
f"| {cells} |"
)

def page_section(label, slug):
return (
f"<details>\n"
f"<summary><strong>{label}</strong></summary>\n\n"
f"**Light**\n\n{theme_table(slug, 'light')}\n\n"
f"**Dark**\n\n{theme_table(slug, 'dark')}\n\n"
f"</details>"
Comment thread
vitorvasc marked this conversation as resolved.
)

pages = [
Expand All @@ -140,9 +153,7 @@ jobs:
("Collector Detail", "collector-detail"),
]

sections = "\n\n".join(
f"**{label}**\n\n{table(slug)}" for label, slug in pages
)
sections = "\n\n".join(page_section(label, slug) for label, slug in pages)

footer = (
f"_Captured from [`{short_sha}`]({commit_url}) on `{head_ref}` "
Expand Down
Loading