16 KiB
🧱 Core
Metrics also have general options that impact global metrics rendering.
➡️ Available options
| Option | Type (format) [default] {allowed values} | Description |
|---|---|---|
token 🔐 |
token |
GitHub Personal Token |
user |
string [] |
GitHub username |
repo |
string [] |
GitHub repository |
committer_token 🔐 |
token [${{ github.token }}] |
GitHub Token used to commit metrics |
committer_branch |
string [] |
Branch used to commit rendered metrics |
committer_message |
string [Update ${filename} - [Skip GitHub Action]] |
Commit message |
committer_gist |
string [] |
Gist used to store metrics |
filename |
string [github-metrics.*] |
Rendered metrics output path |
markdown |
string [TEMPLATE.md] |
Rendered markdown output path |
markdown_cache |
string [.cache] |
Rendered markdown file cache |
output_action |
string [commit] {"none", "commit", "pull-request", "pull-request-merge", "pull-request-squash", "pull-request-rebase", "gist"} |
Output action |
output_condition |
string [always] {"always", "data-changed"} |
Output condition |
optimize |
array (comma-separated) [css, xml] {"css", "xml", "svg"} |
SVG optimization |
setup_community_templates |
array (comma-separated,/(?[-a-z0-9]+)/@(?[-a-z0-9]+):(?[-a-z0-9]+)/) []
Additional community templates to setup
template
string [classic]
Template to use
query
json [{}]
Additional query parameters
extras_css
string []
Extra CSS
config_timezone
string []
Timezone used
config_order
array (comma-separated) []
Configure content order
config_twemoji
boolean [no]
Use twemojis instead of emojis
config_gemoji
boolean [yes]
Use GitHub custom emojis
config_display
string [regular] {"regular", "large", "columns"}
Render display width
config_animations
boolean [yes]
SVG CSS animations
config_base64
boolean [yes]
Encode images links into base64 data
config_padding
string [0, 8 + 11%]
Image padding
config_output
string [auto] {"auto", "svg", "png", "jpeg", "json", "markdown", "markdown-pdf", "insights"}
Output image format
retries
number [3] {1 ≤ 𝑥 ≤ 10}
Number of retries
retries_delay
number [300] {0 ≤ 𝑥 ≤ 3600}
Time to wait (in seconds) before each retry
retries_output_action
number [5] {1 ≤ 𝑥 ≤ 10}
Number of retries (output action)
retries_delay_output_action
number [120] {0 ≤ 𝑥 ≤ 3600}
Time to wait (in seconds) before each retry (output action)
plugins_errors_fatal
boolean [no]
Die on plugins errors
debug
boolean [no]
Debug logs
verify
boolean [no]
Verify SVG
debug_flags
array (space-separated) [] {"--cakeday", "--hireable", "--halloween", "--error"}
Debug flags
dryrun
boolean [no]
Enable dry-run
experimental_features
array (space-separated) [] {"--optimize-svg"}
Experimental features
use_mocked_data
boolean [no]
Use mocked data instead of live APIs
use_prebuilt_image
boolean [yes]
Use pre-built image from GitHub registry
delay
number [0] {0 ≤ 𝑥 ≤ 3600}
Use this to avoid triggering abuse mechanics on large workflows
Legend for option icons:
🛠️ General configurationA GitHub personal access token is required in By default, metrics will be generated for the user who owns the To generate metrics for a repository, use Committer options lets you specify how to rendered metrics should be pushed.
Usually leaving default values is fine, but you have the possibility to change which user will commit to repository using You may also be interested in using pull requests instead of commits. When generating multiple metrics, you'll need to save them under different ℹ️ Examples workflows🖼️ Templates configurationTo use a different template, pass its identifier to It is possible to use templates from any forked repositories (not necessarly your own) while using official releases using community templates. Some templates may accept additional custom options that you can pass through the ℹ️ Examples workflows🎨 Custom CSS stylingYou can inject CSS rules using If you make heavy use of this option, consider using community templates instead. ℹ️ Examples workflows🌐 Set timezoneBy default, dates are based on Greenwich meridian (GMT/UTC). Set your timezone (see here for a list of supported timezones) using ℹ️ Examples workflows📦 Ordering contentYou can order metrics content by using It is not mandatory to specify all partials of used templates. Omitted one will be appended using default order. ℹ️ Examples workflows🥳 Render GitHub custom emojisGitHub provide additional emojis which are not registered in Unicode standard (:octocat:, :shipit:, :trollface:, ...). You can choose to render (or not) GitHub emojis. It may increase filesize since it replace special strings by base64 images. ℹ️ Examples workflows🙂 Using twemojis instead of emojisYou can choose to use twemojis instead of regular emojis so rendered metrics are more consistent across all platforms. It may increase filesize since it replace unicode characters by SVG images. ℹ️ Examples workflows↔️ Controlling display sizeSome templates like
ℹ️ Examples workflows🎞️ SVG CSS AnimationsAs rendered metrics use HTML and CSS, some templates have animations.
You can choose to disable them by using ℹ️ Examples workflows🔲 Adjust paddingHeight of rendered metrics is computed after being rendered through an headless browser. As it can depend on fonts and operating system, it is possible that final result is cropped or has blank space at the bottom. You can adjust padding by using Specify a single value to apply it to both height and with, and two values to use the first one for width and the second for height. Both positive and negative values are accepted. The allowed format is ℹ️ Examples workflows🧶 Using commits, pull requests, manual reviews or gists to handle metrics outputIt is possible to configure output behaviour using
It also possible to alter output condition using
ℹ️ Examples workflows♻️ Retrying automatically failed rendering and output actionRendering is subject to external factors and can fail from time to time.
It is possible to mitigate this issue using Output action is also subject to GitHub API rate-limiting and status and can fail from time to time.
It is possible to mitigate this issue using ℹ️ Examples workflows💱 Convert output to PNG/JPEG or JSONIt is possible to convert output from SVG to PNG or JPEG images and even to JSON by using Note that Using ℹ️ Examples workflows🖨️ Convert output to PDFIt is possible to convert output to PDF when using a markdown template by setting It is advised to keep ℹ️ Examples workflows🗜️ Optimize SVG outputIt is possible to optimize SVG output and reducing its filesize to improve loading times and reduce storage. The following optimizations are supported:
ℹ️ Examples workflows✨ Render
|