Add activity plugin (#41)

This commit is contained in:
Simon Lecoq
2021-01-09 18:57:13 +01:00
committed by GitHub
parent 879502c99a
commit 7df6c922dc
15 changed files with 886 additions and 112 deletions

View File

@@ -4,58 +4,61 @@
inputs:
# Personal user token
# No additional scopes are needed, unless if you want to include private repositories metrics or use the traffic plugin
# No additional scopes are needed unless you want to include private repositories metrics
# Some plugins may also require additional scopes
token:
description: GitHub Personal Token
required: true
# Set to "${{ secrets.GITHUB_TOKEN }}"
committer_token:
description: Token used for commits
description: GitHub Token used to commit metrics
default: ""
# User to compute metrics
# Defaults to the owner of "token"
# GitHub username
# Optional, as it defaults "token"'s owner
user:
description: GitHub username
default: ""
# Filepath of generated metrics (relative to repository root)
# Output path for generated metrics, relative to repository's root
filename:
description: Path of SVG image output
default: github-metrics.svg
# Optimize SVG image with SVGO (minify and remove useless attributes and spaces)
# Optimize SVG image with SVGO
# It minifies and removes useless attributes
# Some templates may not support this option
optimize:
description: Optimize SVG image
description: SVG optimization
default: yes
# Set timezone used by metrics
# Timezone used by metrics
# See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# Some plugins will use this setting to calibrate dates
# Some plugins will use it to calibrate dates
config_timezone:
description: Timezone used by metrics
description: Timezone used
default: ""
# Specify output type
# Metrics output type
# Supported values are :
# - svg (support animations and transparency)
# - png (support transparency)
# - jpeg
# - svg
# - png (does not support animations)
# - jpeg (does not support animations and transparency)
config_output:
description: Output image type
default: svg
# Enable or disable SVG animations
# Enable or disable SVG CSS animations
config_animations:
description: Enable or disable SVG animations
description: SVG CSS animations
default: yes
# Add bottom padding (percentage)
# This can used to add padding if generated image is cropped or on the contrary, remove empty space
# Configure padding for output image (percentage)
# It can be used to add padding to generated metrics if rendering is cropped or has too much empty space
# You can specify one value (for both width and height) and two values (one for width and one for height, seperated by a comma)
config_padding:
description: Configure bottom padding
description: Image padding
default: 6%
# Number of repositories to use for metrics
@@ -363,6 +366,40 @@ inputs:
description: Display stargazers evolution over the last two weeks
default: no
# Display recent activity
plugin_activity:
description: Display recent activity
default: no
# Number of activity events to display
# Capped to 100
plugin_activity_limit:
description: Number of activity events to display
default: 5
# Disacard older events
# Use 0 to display activity whatever the date
plugin_activity_days:
description: Maximum activity event age
default: 14
# Events type to display
# Pass a string of comma-separated values
# Supported values are
# - "comment" for all kind of comments (commits, issue and pr)
# - "ref/create" and "ref/delete" for tag and branch creation/deletion
# - "release" for new published releases
# - "wiki" for wiki edition
# - "push" for pushed commits
# - "issue" and "pr" for issues and pull requests
# - "review" for pull requests review
# - "public" for repositories made public
# - "fork" and "star" for forked and starred repositories
# - "member" for accepted repository invitations
plugin_activity_filter:
description: Events to display
default: all
# ====================================================================================
# Options below are mostly used for testing
@@ -417,7 +454,7 @@ branding:
# 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
# On a forked action, it'll rebuild the docker image from Dockerfile to take into account changes you made
runs:
using: composite
steps:
@@ -458,7 +495,7 @@ runs:
set +e
METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0)
set -e
echo "Unreleased: $METRICS_IS_RELEASED"
echo "Is released version: $METRICS_IS_RELEASED"
# Rebuild image for unreleased version
if [[ $METRICS_IS_RELEASED ]]; then
echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry"