Last active
August 25, 2025 16:42
-
-
Save luboszima/0a55806ee45011bd7686662b9f2fdcd1 to your computer and use it in GitHub Desktop.
glance wiget for Github Notifications
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
| - type: custom-api | |
| title: GitHub Notifications | |
| url: https://api.github.com/notifications?all=true&per_page=20 | |
| headers: | |
| Authorization: Bearer ${GITHUB_TOKEN} | |
| Accept: application/vnd.github+json | |
| template: | | |
| <ul class="list list-gap-14 collapsible-container" data-collapse-after="6"> | |
| {{ range .JSON.Array "" }} | |
| {{ $url := concat (.String "repository.html_url") "/actions" }} | |
| {{ if ne (.String "subject.url") "" }} | |
| {{ | |
| $notification := newRequest (.String "subject.url") | |
| | withHeader "Authorization" "Bearer ${GITHUB_TOKEN}" | |
| | getResponse | |
| }} | |
| {{ if eq $notification.Response.StatusCode 200 }} | |
| {{ $url = $notification.JSON.String "html_url" }} | |
| {{ else }} | |
| {{ $url = (.String "subject.url") | replaceMatches "repos\\/" "" | replaceMatches "api\\." "" | replaceAll "pulls" "pull" }} | |
| {{ end }} | |
| {{ end }} | |
| <li> | |
| <a href="{{ $url }}" class="size-title-dynamic {{ if .Bool "unread" }}color-primary-if-not-visited{{ else }}negative-color{{ end }}" target="_blank" rel="noreferrer">{{ .String "subject.title" }}</a> | |
| <ul class="list-horizontal-text flex-nowrap"> | |
| <li class="min-width-0" {{ .String "updated_at" | parseTime "rfc3339" | toRelativeTime }}></li> | |
| <li class="min-width-0"><a target="_blank" href="{{ $url }}">{{ .String "repository.full_name" }}</a></li> | |
| </ul> | |
| </li> | |
| {{ end }} | |
| </ul> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GITHUB_TOKENvalue will be your tokenThis widget is created to be part of small column.