GitHub metrics #30444
This file contains 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
# This is a workflow showing most of lowlighter/metrics features | |
# If you forked this repository, you should only keep the "github-metrics-personal" job, | |
# and delete the "github-metrics" as it is only used to generate examples | |
# | |
# See https://github.com/lowlighter/metrics/blob/master/action.yml for full options reference | |
# See https://github.com/lowlighter/metrics for additional documentation | |
# | |
# You'll notice that my workflow use a lot of different tokens : | |
# - GITHUB_TOKEN which is an auto-generated token provided by GitHub used to commit your metrics on your repository | |
# - METRICS_TOKEN which is my personal scope-less token | |
# - METRICS_BOT_TOKEN which is a bot account token with more scopes that I use for plugins which requires additional scopes | |
# | |
# There are also a few application tokens : | |
# - PAGESPEED_TOKEN which is a PageSpeed API token (optional for "plugin_pagespeed") | |
# - TWITTER_TOKEN which is twitter API token (mandatory for "plugin_tweets") | |
# - SPOTIFY_TOKENS which contains a client_id, client_secret and a refresh_token for Spotify (mandatory for some mode of "plugin_music") | |
# | |
# The workflow is planned for every hour, but you can change its frequency if you want, | |
# though it's useless to put something lower than 15 minutes as your rendered metrics will probably still be cached by GitHub | |
# | |
# It will also run on each manual commit on "master" branch | |
name: GitHub metrics | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
# The job below generates the images displayed on lowlighter/lowlighter | |
# You can reuse these steps if you want to have a profile page similar to mine. | |
github-metrics-personal: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Personal metrics | |
uses: lowlighter/metrics@latest | |
with: | |
filename: assets/metrics.svg | |
token: ${{ secrets.METRICS_TOKEN }} | |
committer_token: ${{ secrets.GITHUB_TOKEN }} | |
base: "header, activity, repositories" | |
plugin_lines: yes | |
plugin_isocalendar: yes | |
plugin_traffic: yes | |
plugin_languages: yes | |
plugin_languages_ignored: jupyter%20notebook | |
plugin_languages_skipped: '' | |
plugin_habits: yes | |
plugin_habits_from: 200 | |
plugin_habits_days: 14 | |
plugin_habits_facts: yes | |
plugin_habits_charts: yes | |
plugin_gists: yes | |
plugin_topics: yes | |
plugin_topics_sort: stars | |
plugin_topics_limit: 15 | |
config_timezone: America/Los_Angeles | |
# config_order: base.header, isocalendar, base.repositories | |
config_padding: 10% | |
- name: Personal metrics (additional) | |
uses: lowlighter/metrics@latest | |
with: | |
filename: assets/metrics.additional.svg | |
token: ${{ secrets.METRICS_TOKEN }} | |
committer_token: ${{ secrets.GITHUB_TOKEN }} | |
base: "" | |
config_timezone: America/Los_Angeles | |
# config_order: languages, pagespeed, habits, stargazers, stars | |
config_padding: 10% | |
plugin_music: yes | |
plugin_music_provider: spotify | |
plugin_music_mode: recent | |
plugin_music_token: "${{ secrets.SPOTIFY_CLIENT_ID }}, ${{ secrets.SPOTIFY_CLIENT_SECRET }}, ${{ secrets.SPOTIFY_REFRESH_TOKEN }}" | |
plugin_music_limit: 5 | |
plugin_tweets: yes | |
plugin_tweets_token: ${{ secrets.TWITTER_TOKEN }} | |
plugin_activity: yes | |
plugin_activity_limit: 5 | |
plugin_activity_days: 14 | |
plugin_stargazers: yes | |
plugin_stars: yes | |
plugin_stars_limit: 3 | |
# # Note the job below use a bot token with "public_repo" scope | |
# - name: Personal projects | |
# uses: lowlighter/metrics@latest | |
# with: | |
# filename: metrics.projects.svg | |
# token: ${{ secrets.METRICS_BOT_TOKEN }} | |
# committer_token: ${{ secrets.GITHUB_TOKEN }} | |
# user: lowlighter | |
# base: "" | |
# plugin_projects: yes | |
# plugin_projects_repositories: lowlighter/metrics/projects/1 | |
# plugin_projects_limit: 0 | |
# config_timezone: America/Los_Angeles | |