Files
metrics/action.yml
2021-03-14 17:57:01 +01:00

1010 lines
32 KiB
YAML
Generated

# ====================================================================================
# Inputs and configuration
inputs:
# ====================================================================================
# 🗃️ Base content
# Base content
base:
description: Metrics base content
default: header, activity, community, repositories, metadata
# Number of repositories to use to computes metrics
# Using more will result in more accurate metrics, but you may hit GitHub rate-limit more easily if you use a lot of plugins
repositories:
description: Number of repositories to use
default: 100
# Include forked repositories into metrics
repositories_forks:
description: Include forks in metrics
default: no
# Filter repositories by user affiliations
# Note that it may affect some plugin outputs (broad affiliations will result in less representative metrics)
repositories_affiliations:
description: Repositories affiliations
default: owner
# ====================================================================================
# 🧱 Core
# User account personal token
# No additional scopes are needed unless you want to include private repositories metrics
# Some plugins may also require additional scopes
# ────────────────────────────────────────────────────────────────
# If you're only using plugins which don't really require a GitHub token, you may pass "NOT_NEEDED" as value
token:
description: GitHub Personal Token
required: true
# GitHub username
# Defaults to "token" owner
user:
description: GitHub username
default: ""
# GitHub repository
# Compute metrics for a repository instead ("user" being the repository owner)
# Check https://github.com/lowlighter/metrics/blob/master/source/templates/repository/README.md for more informations
repo:
description: GitHub repository
default: ""
# Set to "${{ github.token }}" or "${{ secrets.GITHUB_TOKEN }}"
# GITHUB_TOKEN is a special auto-generated token restricted to current repository, which is used to push files in it
committer_token:
description: GitHub Token used to commit metrics
default: ${{ github.token }}
# Branch used to commit rendered metrics
committer_branch:
description: Branch used to commit rendered metrics
default: ""
# Commit message
# Use "${filename}" to display filename
committer_message:
description: Commit message
default: Update ${filename} - [Skip GitHub Action]
# Rendered metrics output path, relative to repository's root
filename:
description: Rendered metrics output path
default: github-metrics.svg
# Output action
output_action:
description: Output action
default: commit
# Optimize SVG image to reduce its filesize
# Some templates may not support this option
optimize:
description: SVG optimization
default: yes
# Setup additional templates from remote repositories
setup_community_templates:
description: Additional community templates to setup
default: ""
# Template to use
# To use community template, prefix its name with "@"
template:
description: Template to use
default: classic
# Additional query parameters (JSON string)
# Some templates may require additional parameters which you can specify here
# Do not use this option to pass plugins parameters as they'll be overwritten by the other options
query:
description: Additional query parameters
default: "{}"
# Timezone used by metrics
# See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
config_timezone:
description: Timezone used
default: ""
# Specify in which order metrics content will be displayed
# If you omit some partials, they'll be appended at the end in default order
# See "partials/_.json" of each template for a list of supported partials
config_order:
description: Configure content order
default: ""
# Use twemojis instead of emojis
# May increase filesize but emojis will be rendered the same across all platforms
config_twemoji:
description: Use twemojis instead of emojis
default: no
# Render GitHub custom emojis (like ":octocat:", see full list at https://api.github.com/emojis)
# May increase filesize
config_gemoji:
description: Use GitHub custom emojis
default: yes
# Enable SVG CSS animations
config_animations:
description: SVG CSS animations
default: yes
# Configure padding for output image (percentage value)
# It can be used to add padding to generated metrics if rendering is cropped or has too much empty space
# Specify one value (for both width and height) or two values (one for width and one for height)
config_padding:
description: Image padding
default: 6%, 13%
# Metrics output format
config_output:
description: Output image format
default: svg
# Number of retries in case rendering fail
retries:
description: Number of retries
default: 3
# Time to wait (in seconds) before each retry
retries_delay:
description: Time to wait (in seconds) before each retry
default: 300
# Throw on plugins errors
# If disabled, metrics will handle errors gracefully with a message in rendered metrics
plugins_errors_fatal:
description: Die on plugins errors
default: no
# Debug mode
# Note that this will automatically be enabled if job fails
debug:
description: Debug logs
default: no
# Ensure SVG can be correctly parsed after generation
verify:
description: Verify SVG
default: no
# Debug flags
debug_flags:
description: Debug flags
default: ""
# Dry-run mode (perform generation without output)
# Unlike "output_action" set to "none", output file won't be available in "/metrics_renders"
dryrun:
description: Enable dry-run
default: no
# Experimental features
experimental_features:
description: Experimental features
default: ""
# Use mocked data to bypass external APIs
use_mocked_data:
description: Use mocked data instead of live APIs
default: no
# Use a pre-built image from GitHub registry when using unreleased versions of "lowlighter/metrics"
# This option has no effect on forks (images will always be rebuilt from Dockerfile)
# See https://github.com/users/lowlighter/packages/container/package/metrics for more information
use_prebuilt_image:
description: Use pre-built image from GitHub registry
default: yes
# ====================================================================================
# 📅 Isometric commit calendar
# Enable or disable plugin
plugin_isocalendar:
description: Display an isometric view of your commits calendar
default: no
# Set time window shown by isometric calendar
plugin_isocalendar_duration:
description: Set time window shown by isometric calendar
default: half-year
# ====================================================================================
# 🈷️ Most used languages
# Enable or disable plugin
plugin_languages:
description: Display most used languages metrics
default: no
# List of languages that will be ignored
plugin_languages_ignored:
description: Languages to ignore
default: ""
# List of repositories that will be skipped
plugin_languages_skipped:
description: Repositories to skip
default: ""
# Overrides default languages colors
# Use `${n}:${color}` to change the color of the n-th most used language (e.g. "0:red" to make your most used language red)
# Use `${language}:${color}` to change the color of named language (e.g. "javascript:red" to make JavaScript language red, language case is ignored)
# Use a value from `colorsets.json` to use a predefined set of colors
# Both hexadecimal and named colors are supported
plugin_languages_colors:
description: Custom languages colors
default: github
# Languages additional details
plugin_languages_details:
description: Additional details
default: ""
# Minimum threshold (in percentage) to reach for languages to be displayed
plugin_languages_threshold:
description: Minimum threshold
default: 0%
# ====================================================================================
# 🙋 Introduction
# Enable or disable plugin
plugin_introduction:
description: Display account or repository introduction
default: no
# Display introduction section title
plugin_introduction_title:
description: Display introduction section title
default: yes
# ====================================================================================
# 💡 Coding habits
# Enable or disable plugin
plugin_habits:
description: Display coding habits metrics
default: no
# Number of events to use to computes habits
# Using more will result in more accurate metrics, but you may hit GitHub rate-limit more easily
plugin_habits_from:
description: Number of events to use
default: 200
# Filter used events to compute habits by age
plugin_habits_days:
description: Maximum event age
default: 14
# Display tidbits about your most active hours/days, indents used (spaces/tabs), etc.
# This is deduced from your recent activity
plugin_habits_facts:
description: Display coding habits collected facts based on recent activity
default: yes
# Display charts of most active time of the day and most active day of the week
# Also display languages recently used (this is not the same as plugin_languages, as the latter is an all-time stats)
plugin_habits_charts:
description: Display coding habits charts based on recent activity
default: no
# ====================================================================================
# 📜 Repository licenses
# Enable or disable plugin
plugin_licenses:
description: Display licenses informations
default: no
# Command to use to setup target repository
# It is required to install all dependencies that will be analyzed with github/licensed
plugin_licenses_setup:
description: Command to setup target repository
default: ""
# Display used licenses from both repository license and dependencies licenses ratio
plugin_licenses_ratio:
description: Display used licenses ratio
default: no
# Display permissions, limitations and conditions from both repository license and dependencies licenses
# Note that this is NOT legal advice, use at your own risk
plugin_licenses_legal:
description: Display legal informations about used licenses
default: yes
# ====================================================================================
# 🏅 Repository contributors
# Enable or disable plugin
plugin_contributors:
description: Display repository contributors
default: no
# Base reference (commit, tag, branch, etc.)
plugin_contributors_base:
description: Base reference
default: ""
# Head reference (commit, tag, branch, etc.)
plugin_contributors_head:
description: Head reference
default: master
# Ignored contributors (useful to ignore bots users)
plugin_contributors_ignored:
description: Contributors to ignore
default: github-actions[bot]
# Display total contributions for each contributor
plugin_contributors_contributions:
description: Display contributions
default: no
# ====================================================================================
# 🌟 Recently starred repositories
# Enable or disable plugin
plugin_stars:
description: Display recently starred repositories
default: no
# Number of stars to display
plugin_stars_limit:
description: Maximum number of stars to display
default: 4
# ====================================================================================
# 📌 Starred topics
# Enable or disable plugin
plugin_topics:
description: Display starred topics
default: no
# Plugin mode
plugin_topics_mode:
description: Plugin mode
default: starred
# Topics sorting order
plugin_topics_sort:
description: Sorting method of starred topics
default: stars
# Number of topics to display
# Set to 0 to disable limitations
# When in "starred" mode, additional topics will be grouped into an ellipsis
plugin_topics_limit:
description: Maximum number of topics to display
default: 15
# ====================================================================================
# 🎭 Comment reactions
# Enable or disable plugin
plugin_reactions:
description: Display average issue comments reactions
default: no
# Maximum number of issue comments to parse
# Issues will be fetched before issues comments
plugin_reactions_limit:
description: Maximum number of issue comments to parse
default: 200
# Filter reactions by issue comments age
# Set to 0 to disable age filtering
plugin_reactions_days:
description: Maximum issue comments age
default: 0
# Reaction display mode.
# Use this option to fill gauges using:
# - "absolute" to use total reactions count
# - "relative" to use highest reaction count
plugin_reactions_display:
description: Display mode
default: absolute
# Additional details
# If multiple values are specified, emphasis will be set on first value
plugin_reactions_details:
description: Additional details
default: ""
# ====================================================================================
# 🧑‍🤝‍🧑 People plugin
# Enable or disable plugin
plugin_people:
description: Display GitHub users from various affiliations
default: no
# Number of users to display per section
plugin_people_limit:
description: Maximum number of user to display
default: 28
# Size of displayed user's avatar
plugin_people_size:
description: Size of displayed GitHub users' avatars
default: 28
# List of section to display
# Ordering will be kept
plugin_people_types:
description: Affiliations to display
default: followers, following
# When displaying "thanks" section, specified users list will be displayed
# This is useful to craft "Special thanks" badges
plugin_people_thanks:
description: GitHub users to personally thanks
default: ""
# Add specified users to GitHub sponsors ("sponsors" must be specified in "plugin_people_types")
# This is useful to list sponsors from unsupported GitHub sponsors sources
plugin_people_sponsors_custom:
description: Custom GitHub sponsors
default: ""
# Use GitHub identicons instead of users' avatar (for privacy purposes)
plugin_people_identicons:
description: Use identicons instead of avatars
default: no
# Shuffle users for varied outputs
# If "plugin_people_limit" is set, plugin will fetch up to 10 ten times limit to ensure output is different each time
plugin_people_shuffle:
description: Shuffle users
default: no
# ====================================================================================
# 🎫 Gists
# Enable or disable plugin
plugin_gists:
description: Display gists metrics
default: no
# ====================================================================================
# 🎟️ Follow-up of issues and pull requests
# Enable or disable plugin
plugin_followup:
description: Display follow-up of repositories issues and pull requests
default: no
# ====================================================================================
# 👨‍💻 Lines of code changed
# Enable or disable plugin
plugin_lines:
description: Display lines of code metrics
default: no
# ====================================================================================
# 🧮 Repositories traffic
# Enable or disable plugin
plugin_traffic:
description: Display repositories traffic metrics
default: no
# ====================================================================================
# ✨ Stargazers over last weeks
# Enable or disable plugin
plugin_stargazers:
description: Display stargazers metrics
default: no
# ====================================================================================
# 🗂️ Active projects
# Enable or disable plugin
plugin_projects:
description: Display active projects
default: no
# Number of projects to display
# Set to 0 to only display "plugin_projects_repositories" projects
# Projects listed in "plugin_projects_repositories" are not affected by this option
plugin_projects_limit:
description: Maximum number of projects to display
default: 4
# List of repository projects to display, using the following format:
# :user/:repo/projects/:project_id
plugin_projects_repositories:
description: List of repository project identifiers to disaplay
default: ""
# Display projects descriptions
plugin_projects_descriptions:
description: Display projects descriptions
default: no
# ====================================================================================
# 📰 Recent activity
# Enable or disable plugin
plugin_activity:
description: Display recent activity
default: no
# Number of activity events to display
plugin_activity_limit:
description: Maximum number of events to display
default: 5
# Filter events by age
# Set to 0 to disable age filtering
plugin_activity_days:
description: Maximum event age
default: 14
# Filter events by type
plugin_activity_filter:
description: Events types to keep
default: all
# Set events visibility (use this to restrict events when using a "repo" token)
plugin_activity_visibility:
description: Set events visibility
default: all
# Display events timestamps
plugin_activity_timestamps:
description: Display events timestamps
default: no
# ====================================================================================
# 🏆 Achievements
# Enable or disable plugin
plugin_achievements:
description: Display achievements
default: no
# Minimal rank to display
plugin_achievements_threshold:
description: Display rank minimal threshold
default: C
# Display secrets achievements unlocked
plugin_achievements_secrets:
description: Display unlocked secrets achievements
default: yes
# Number of achievements events to display
# Set to 0 to disable limitations
plugin_achievements_limit:
description: Maximum number of achievements to display
default: 0
# List of unlocked achievements to hide
# Names must be given in lower case, without rank adjective
plugin_achievements_ignored:
description: Unlocked achievements to hide
default: ""
# List of unlocked achievements to display
# Names must be given in lower case, without rank adjective
# Using this option is equivalent of using "plugin_achievements_ignored" with all existing achievements but the ones listed
plugin_achievements_only:
description: Unlocked achievements to display
default: ""
# ====================================================================================
# 🌇 GitHub Skyline 3D calendar
# Enable or disable plugin
plugin_skyline:
description: Display GitHub Skyline 3D calendar
default: no
# Displayed year
plugin_skyline_year:
description: Displayed year
default: current-year
# Number of frames
# Use 120 for a full-loop and 60 for a half-loop
plugin_skyline_frames:
description: Number of frames
default: 60
# Image quality
# Note that it significantly increases output filesize (up to a few Mb) which can cause render/loading issues
plugin_skyline_quality:
description: Image quality
default: 0.5
# ====================================================================================
# ⏱️ Website performances
# Enable or disable plugin
plugin_pagespeed:
description: Display a website Google PageSpeed metrics
default: no
# Website to audit with PageSpeed
plugin_pagespeed_url:
description: Audited website
default: .user.website
# Display the following additional metrics from audited website:
# First Contentful Paint, Speed Index, Largest Contentful Paint, Time to Interactive, Total Blocking Time, Cumulative Layout Shift
# See https://web.dev/performance-scoring/ and https://googlechrome.github.io/lighthouse/scorecalc/ for more informations
plugin_pagespeed_detailed:
description: Detailed audit result
default: no
# Display a screenshot of audited website
# May increases significantly filesize
plugin_pagespeed_screenshot:
description: Display a screenshot of your website
default: no
# PageSpeed API token
# This is optional, but providing it will avoid hitting rate-limiter
# See https://developers.google.com/speed/docs/insights/v5/get-started for more informations
plugin_pagespeed_token:
description: PageSpeed token
default: ""
# ====================================================================================
# 🎼 Music plugin
# Enable or disable plugin
plugin_music:
description: Display your music tracks
default: no
# Name of music provider
# This is optional for "playlist" mode (it can be deduced automatically from "plugin_music_playlist" url)
# This is required in other modes
plugin_music_provider:
description: Music provider
default: ""
# Music provider token
# This may be required depending on music provider used and plugin mode
# - "apple" : not required
# - "spotify" : required for "recent" mode, format is "client_id, client_secret, refresh_token"
# - "lastfm" : required, format is "api_key"
plugin_music_token:
description: Music provider personal token
default: ""
# Plugin mode
plugin_music_mode:
description: Plugin mode
default: ""
# Embed playlist url (i.e. url used by music player iframes)
plugin_music_playlist:
description: Embed playlist url
default: ""
# Number of music tracks to display
plugin_music_limit:
description: Maximum number of tracks to display
default: 4
# Display when track was last played
plugin_music_played_at:
description: Display when the track was played
default: no
# Username on music provider service
plugin_music_user:
description: Music provider username
default: .user.login
# ====================================================================================
# 🐤 Latest tweets
# Enable or disable plugin
plugin_tweets:
description: Display recent tweets
default: no
# Twitter API token
# See https://apps.twitter.com for more informations
plugin_tweets_token:
description: Twitter API token
default: ""
# Display tweets attachments (images, video previews, etc.)
plugin_tweets_attachments:
description: Display tweets attchments
default: no
# Number of tweets to display
plugin_tweets_limit:
description: Maximum number of tweets to display
default: 2
# Twitter username
plugin_tweets_user:
description: Twitter username
default: .user.twitter
# ====================================================================================
# 🌸 Anilist watch list and reading list
# Enable or disable plugin
plugin_anilist:
description: Display data from your AniList account
default: no
# Types of medias to display
plugin_anilist_medias:
description: Medias types to display
default: anime, manga
# Sections to display
# Values from "plugin_anilist_medias" may impact displayed sections
plugin_anilist_sections:
description: Sections to display
default: favorites
# Number of entries to display per section (this does not impacts characters section)
# Set to 0 to disable limitations
plugin_anilist_limit:
description: Maximum number of entries to display per section
default: 2
# Number of entries to display in characters section
# Set to 0 to disable limitations
plugin_anilist_limit_characters:
description: Maximum number of entries to display in characters section
default: 22
# Shuffle AniList data for varied outputs
plugin_anilist_shuffle:
description: Shuffle AniList data
default: yes
# Username on AniList
plugin_anilist_user:
description: AniList login
default: .user.login
# ====================================================================================
# 🗨️ Stackoverflow plugin
# Enable or disable plugin
plugin_stackoverflow:
description: Stackoverflow metrics
default: no
# Stackoverflow user id
# To obtain it, extract the identifier on your account page url
plugin_stackoverflow_user:
description: Stackoverflow user id
default: 0
# Sections to display
plugin_stackoverflow_sections:
description: Sections to display
default: answers-top, questions-recent
# Number of entries to display per section
plugin_stackoverflow_limit:
description: Maximum number of entries to display per section
default: 2
# Number of lines to display per question or answer
# Set to 0 to disable limitations
plugin_stackoverflow_lines:
description: Maximum number of lines to display per question or answer
default: 4
# ====================================================================================
# ✒️ Recent posts
# Enable or disable plugin
plugin_posts:
description: Display recent posts
default: no
# Posts external source
plugin_posts_source:
description: Posts external source
default: ""
# Display a few lines about each posts
plugin_posts_descriptions:
description: Display posts descriptions
default: no
# Display posts cover images
plugin_posts_covers:
description: Display posts cover images
default: no
# Number of posts to display
plugin_posts_limit:
description: Maximum number of posts to display
default: 4
# Username on external posts source
plugin_posts_user:
description: Posts external source username
default: .user.login
# ====================================================================================
# ⏰ WakaTime plugin
# Enable or disable plugin
plugin_wakatime:
description: Display WakaTime stats
default: no
# WakaTime API token
# See https://wakatime.com/settings/account get your API key
plugin_wakatime_token:
description: WakaTime API token
default: ""
# Time range to use for displayed stats
plugin_wakatime_days:
description: WakaTime time range
default: 7
# Sections to display
plugin_wakatime_sections:
description: Sections to display
default: time, projects, projects-graphs, languages, languages-graphs, editors, os
# Number of entries to display per graph
# Set to 0 to disable limitations
plugin_wakatime_limit:
description: Maximum number of entries to display per graph
default: 5
# ====================================================================================
# 💉 Nightscout
# Enable or disable plugin
plugin_nightscout:
description: Displays Blood Glucose
default: no
# Nightscout site URL
plugin_nightscout_url:
description: Your Nightscout site URL
default: https://example.herokuapp.com
# Controls how big the graph is
plugin_nightscout_datapoints:
description: How many datapoints to show on the graph. 0 and 1 disable the graph.
default: 12
# Low value used for colors and text alerts
plugin_nightscout_lowalert:
description: When the blood sugar is considered low
default: 80
# High value used for colors and text alerts
plugin_nightscout_highalert:
description: When the blood sugar is considered high
default: 180
# Urgent low value used for colors and text alerts
plugin_nightscout_urgentlowalert:
description: When the blood sugar is considered urgently low
default: 50
# Urgent high value used for colors and text alerts
plugin_nightscout_urgenthighalert:
description: When the blood sugar is considered urgently high
default: 250
# ====================================================================================
# Action metadata
name: GitHub metrics as SVG image
author: lowlighter
description: An SVG generator with 20+ metrics about your GitHub account! Additional plugins are available to display even more!
branding:
icon: user-check
color: gray-dark
# The action will parse its name to check if it's the official action or if it's a forked one
# On the official action, it'll use the docker image published on GitHub registry when using a released version, allowing faster runs
# On a forked action, it'll rebuild the docker image from Dockerfile to take into account changes you made
runs:
using: composite
steps:
- run: |
# Create environment file from inputs and GitHub variables
echo "::group::Metrics docker image setup"
cd $METRICS_ACTION_PATH
touch .env
for INPUT in $(echo $INPUTS | jq -r 'to_entries|map("INPUT_\(.key|ascii_upcase)=\(.value|@uri)")|.[]'); do
echo $INPUT >> .env
done
env | grep -E '^(GITHUB|ACTIONS|CI)' >> .env
echo "Environment variables: loaded"
# Renders output folder
METRICS_RENDERS="/metrics_renders"
sudo mkdir -p $METRICS_RENDERS
echo "Renders output folder: $METRICS_RENDERS"
# Source repository (picked from action name)
METRICS_SOURCE=$(echo $METRICS_ACTION | sed -E 's/metrics.*?$//g')
echo "Source: $METRICS_SOURCE"
# Version (picked from package.json)
METRICS_VERSION=$(grep -Po '(?<="version": ").*(?=")' package.json)
echo "Version: $METRICS_VERSION"
# Image tag (extracted from version or from env)
METRICS_TAG=v$(echo $METRICS_VERSION | sed -r 's/^([0-9]+[.][0-9]+).*/\1/')
echo "Image tag: $METRICS_TAG"
# Image name
# Official action
if [[ $METRICS_SOURCE == "lowlighter" ]]; then
# Use registry with pre-built images
if [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then
# Is released version
set +e
METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0)
set -e
echo "Is released version: $METRICS_IS_RELEASED"
if [[ "$METRICS_IS_RELEASED" -eq "0" ]]; then
METRICS_TAG="$METRICS_TAG-beta"
echo "Image tag (updated): $METRICS_TAG"
fi
METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG
echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry"
docker image pull $METRICS_IMAGE
# Rebuild image
else
echo "Using an unreleased version ($METRICS_VERSION)"
METRICS_IMAGE=metrics:$METRICS_VERSION
fi
# Forked action
else
echo "Using a forked version"
METRICS_IMAGE=metrics:forked-$METRICS_VERSION
fi
echo "Image name: $METRICS_IMAGE"
# Build image if necessary
set +e
docker image inspect $METRICS_IMAGE
METRICS_IMAGE_NEEDS_BUILD="$?"
set -e
if [[ "$METRICS_IMAGE_NEEDS_BUILD" -gt "0" ]]; then
echo "Image $METRICS_IMAGE is not present locally, rebuilding it from Dockerfile"
docker build -t $METRICS_IMAGE .
else
echo "Image $METRICS_IMAGE is present locally"
fi
echo "::endgroup::"
# Run docker image with current environment
docker run --init --volume $GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH --volume $METRICS_RENDERS:/renders --env-file .env $METRICS_IMAGE
rm .env
shell: bash
env:
METRICS_ACTION: ${{ github.action }}
METRICS_ACTION_PATH: ${{ github.action_path }}
METRICS_USE_PREBUILT_IMAGE: ${{ inputs.use_prebuilt_image }}
INPUTS: ${{ toJson(inputs) }}