Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
github-mcp-server/script/fetch-icons at v1.14.0 · github/github-mcp-server · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
github
github-mcp-server
Repository navigation
Code
Issues
206
(206)
Pull requests
199
(199)
Discussions
Actions
Security and quality
2
(2)
Insights
More
items
Files
Expand file tree
v1.14.0
Breadcrumbs
github-mcp-server
/
script
/
fetch-icons
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
84 lines (71 loc) · 2.96 KB
v1.14.0
Breadcrumbs
github-mcp-server
/
script
/
fetch-icons
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
84 lines (71 loc) · 2.96 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!
/bin/bash
#
Fetch Octicon icons and convert them to PNG and embedded data URIs.
#
Generates both light theme (dark icons) and dark theme (white icons) variants.
#
Uses sed to modify SVG fill color before converting to PNG.
#
Requires: rsvg-convert (from librsvg2-bin on Ubuntu/Debian), base64
#
#
Usage:
#
script/fetch-icons # Fetch all required icons
#
script/fetch-icons icon1 icon2 # Fetch specific icons
set
-e
SCRIPT_DIR=
"
$(
cd
"
$(
dirname
"
${BASH_SOURCE[0]}
"
)
"
&&
pwd
)
"
REPO_ROOT=
"
$(
cd
"
$SCRIPT_DIR
/..
"
&&
pwd
)
"
ICONS_DIR=
"
$REPO_ROOT
/pkg/octicons/icons
"
DATA_URIS_FILE=
"
$REPO_ROOT
/pkg/octicons/icons_data_uris.txt
"
REQUIRED_ICONS_FILE=
"
$REPO_ROOT
/pkg/octicons/required_icons.txt
"
OCTICONS_BASE=
"
https://raw.githubusercontent.com/primer/octicons/main/icons
"
#
Check for rsvg-convert
if
!
command
-v rsvg-convert
&
>
/dev/null
;
then
echo
"
Error: rsvg-convert not found. Install with:
"
echo
"
Ubuntu/Debian: sudo apt-get install librsvg2-bin
"
echo
"
macOS: brew install librsvg
"
exit
1
fi
#
Load icons from required_icons.txt or use command-line arguments
if
[
$#
-gt
0 ]
;
then
ICONS=(
"
$@
"
)
else
if
[
!
-f
"
$REQUIRED_ICONS_FILE
"
]
;
then
echo
"
Error: Required icons file not found:
$REQUIRED_ICONS_FILE
"
exit
1
fi
#
Read icons from file, skipping comments and empty lines
mapfile -t ICONS
<
<(
grep -v
'
^#
'
"
$REQUIRED_ICONS_FILE
"
|
grep -v
'
^$
'
)
fi
#
Ensure icons directory exists
mkdir -p
"
$ICONS_DIR
"
echo
"
Fetching
${
#
ICONS[@]}
icons (24px, light + dark themes)...
"
for
icon
in
"
${ICONS[@]}
"
;
do
svg_url=
"
${OCTICONS_BASE}
/
${icon}
-24.svg
"
light_file=
"
${ICONS_DIR}
/
${icon}
-light.png
"
dark_file=
"
${ICONS_DIR}
/
${icon}
-dark.png
"
echo
"
${icon}
(light + dark)
"
#
Download SVG
svg_content=
$(
curl -sfL
"
$svg_url
"
2>
/dev/null
)
||
{
echo
"
Warning: Failed to fetch
${icon}
-24.svg (may not exist)
"
continue
}
#
Light theme: dark icons (#24292f) for light backgrounds
#
Add fill attribute to the svg tag
light_svg=
$(
echo
"
$svg_content
"
|
sed
'
s/<svg /<svg fill="#24292f" /
'
)
echo
"
$light_svg
"
|
rsvg-convert -o
"
$light_file
"
#
Dark theme: white icons (#ffffff) for dark backgrounds
dark_svg=
$(
echo
"
$svg_content
"
|
sed
'
s/<svg /<svg fill="#ffffff" /
'
)
echo
"
$dark_svg
"
|
rsvg-convert -o
"
$dark_file
"
done
data_uris_tmp=
$(
mktemp
)
trap
'
rm -f "$data_uris_tmp"
'
EXIT
for
icon_file
in
"
$ICONS_DIR
"
/
*
.png
;
do
filename=
$(
basename
"
$icon_file
"
.png
)
encoded_png=
$(
base64
<
"
$icon_file
"
)
printf
'
%s\tdata:image/png;base64,%s\n
'
"
$filename
"
"
${encoded_png
//
$'
\n
'
/
}
"
>>
"
$data_uris_tmp
"
done
mv
"
$data_uris_tmp
"
"
$DATA_URIS_FILE
"
trap
- EXIT
echo
"
Done. Icons saved to
$ICONS_DIR
"
echo
"
Data URIs saved to
$DATA_URIS_FILE
"
echo
"
"
echo
"
Next steps:
"
echo
"
1. Run 'go test ./pkg/octicons/...' to verify icons are embedded
"
echo
"
2. Run 'go test ./pkg/github/...' to verify toolset icons are valid
"
echo
"
3. Commit the new icon files and generated data URIs
"
You can’t perform that action at this time.