diff --git a/.github/scripts/files/examples.yml b/.github/scripts/files/examples.yml index be8c76f8..a7efbb93 100644 --- a/.github/scripts/files/examples.yml +++ b/.github/scripts/files/examples.yml @@ -11,10 +11,27 @@ jobs: examples: runs-on: ubuntu-latest - if: "github.repository == 'lowlighter/metrics'" + if: false steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Checkout examples + run: git checkout examples + <%- steps.split("\n").map(line => ` ${line}`).join("\n") %> + - name: Publish examples + run: | + set +e + sudo mv /metrics_renders/* ./ + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git add --all + git commit -m "chore: update examples" + git push + # ====================================================================================== # Markdown as png (for readme updates) # ====================================================================================== @@ -22,7 +39,6 @@ jobs: examples-markdown: runs-on: ubuntu-latest if: false - #if: "github.repository == 'lowlighter/metrics'" container: ghcr.io/lowlighter/metrics:master needs: [examples] steps: @@ -56,6 +72,13 @@ jobs: runs-on: ubuntu-latest if: "github.repository == 'lowlighter/metrics'" steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Checkout examples + run: git checkout examples + - name: Contributors if: ${{ success() || failure() }} uses: lowlighter/metrics@master @@ -72,7 +95,6 @@ jobs: config_display: large output_action: none delay: 120 - - name: Sponsors if: ${{ success() || failure() }} uses: lowlighter/metrics@master @@ -88,7 +110,6 @@ jobs: config_display: large output_action: none delay: 120 - - name: Licenses if: ${{ success() || failure() }} uses: lowlighter/metrics@master @@ -105,3 +126,13 @@ jobs: plugins_errors_fatal: ${{ github.repository == 'lowlighter/lowlighter' }} output_action: none delay: 120 + + - name: Publish examples + run: | + set +e + sudo mv /metrics_renders/* ./ + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git add --all + git commit -m "chore: update examples" + git push diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 00000000..0df9e93f --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,1023 @@ +name: Examples +on: + schedule: + - cron: "0 8 * * *" + workflow_dispatch: +jobs: + +# ====================================================================================== +# Examples renders +# ====================================================================================== + + examples: + runs-on: ubuntu-latest + if: false + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Checkout examples + run: git checkout examples + + - name: 🗃️ Base content - Default metrics + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + base: header, activity, community, repositories, metadata + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🧱 Core - Organization + uses: lowlighter/metrics@master + with: + user: github + token: ${{ secrets.METRICS_BOT_TOKEN }} + base: header, repositories + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🧱 Core - Large display + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + config_display: large + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🧱 Core - JSON metrics + if: ${{ success() || failure() }} + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + config_output: json + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + - name: 🧱 Core - PNG metrics + if: ${{ success() || failure() }} + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + config_output: png + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + - name: 🧱 Core - Plugin error example + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_projects: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📅 Isometric commit calendar - Half-year calendar + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_isocalendar: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📅 Isometric commit calendar - Full-year calendar + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_isocalendar: 'yes' + plugin_isocalendar_duration: full-year + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🈷️ Most used languages - Most used + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_languages: 'yes' + plugin_languages_ignored: >- + html, css, tex, less, dockerfile, makefile, qmake, lex, cmake, shell, + gnuplot + plugin_languages_limit: 4 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🈷️ Most used languages - Most used (with details) + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_languages: 'yes' + plugin_languages_ignored: >- + html, css, tex, less, dockerfile, makefile, qmake, lex, cmake, shell, + gnuplot + plugin_languages_details: bytes-size, percentage + plugin_languages_limit: 4 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🈷️ Most used languages - Recently used + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_languages: 'yes' + plugin_languages_ignored: >- + html, css, tex, less, dockerfile, makefile, qmake, lex, cmake, shell, + gnuplot + plugin_languages_sections: recently-used + plugin_languages_details: bytes-size, percentage + plugin_languages_limit: 4 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🈷️ Most used languages - Indepth analysis + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_languages: 'yes' + plugin_languages_ignored: >- + html, css, tex, less, dockerfile, makefile, qmake, lex, cmake, shell, + gnuplot + plugin_languages_indepth: 'yes' + plugin_languages_details: lines, bytes-size + plugin_languages_limit: 4 + plugin_languages_analysis_timeout: 15 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📌 Starred topics - Labels + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_topics: 'yes' + plugin_topics_limit: 12 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📌 Starred topics - Icons + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_topics: 'yes' + plugin_topics_limit: 0 + plugin_topics_mode: icons + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🌟 Recently starred repositories - Recently starred + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_stars: 'yes' + plugin_stars_limit: 3 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📜 Repository licenses - Licenses and permissions + with: + token: ${{ secrets.METRICS_TOKEN }} + template: repository + repo: metrics + plugin_licenses: 'yes' + plugin_licenses_setup: npm ci + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + uses: lowlighter/metrics@master + - name: 📜 Repository licenses - Licenses with open-source ratio graphs + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + template: repository + repo: metrics + plugin_licenses: 'yes' + plugin_licenses_setup: npm ci + plugin_licenses_legal: 'no' + plugin_licenses_ratio: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💡 Coding habits - Midly interesting facts + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_habits: 'yes' + plugin_habits_facts: 'yes' + plugin_habits_charts: 'no' + config_timezone: Europe/Paris + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💡 Coding habits - Recent activity charts + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_habits: 'yes' + plugin_habits_facts: 'no' + plugin_habits_charts: 'yes' + config_timezone: Europe/Paris + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🏅 Repository contributors - Contributors with contributions count + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + template: repository + repo: metrics + plugin_contributors: 'yes' + plugin_contributors_contributions: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🏅 Repository contributors - Contributors by categories + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + template: repository + repo: metrics + plugin_contributors: 'yes' + plugin_contributors_sections: categories + plugin_contributors_categories: | + { + "🧩 Plugins / 🖼️ templates":["source/plugins/**", "source/templates/**"], + "📚 Documentation":["README.md", "**/README.md", "**/metadata.yml"], + "💻 Code (other)":["source/**", "Dockerfile"] + } + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎟️ Follow-up of issues and pull requests - Opened on user's repositories + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_followup: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎟️ Follow-up of issues and pull requests - Opened by user + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_followup: 'yes' + plugin_followup_sections: user + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎟️ Follow-up of issues and pull requests - Indepth analysis + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_followup: 'yes' + plugin_followup_indepth: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎭 Comment reactions - Comment reactions + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_reactions: 'yes' + plugin_reactions_limit: 100 + plugin_reactions_details: percentage + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🧑‍🤝‍🧑 People plugin - Followers + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_people: 'yes' + plugin_people_types: followers + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🧑‍🤝‍🧑 People plugin - Contributors and sponsors + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + template: repository + repo: metrics + plugin_people: 'yes' + plugin_people_types: contributors, stargazers, watchers, sponsors + plugin_people_sponsors_custom: >- + iamsainikhil, yutkat, KasparJohannesSchneider, ktnkk, tfSheol, haribo-io, + marcreichel + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ✨ Stargazers over last weeks - Last weeks stargazers + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_stargazers: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🗂️ Active projects - Project from a repository + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_BOT_TOKEN }} + plugin_projects: 'yes' + plugin_projects_repositories: lowlighter/metrics/projects/1 + plugin_projects_descriptions: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ♐ Code snippet of the day - JavaScript or TypeScript snippet of the day + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_code: 'yes' + plugin_code_languages: javascript, typescript + plugin_code_load: 400 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📰 Recent activity - Recent activity + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_activity: 'yes' + plugin_activity_limit: 5 + plugin_activity_days: 0 + plugin_activity_filter: issue, pr, release, fork, review, ref/create + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🏆 Achievements - Detailed display + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_achievements: 'yes' + plugin_achievements_only: sponsor, maintainer, octonaut + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🏆 Achievements - Compact display + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_achievements: 'yes' + plugin_achievements_only: >- + polyglot, stargazer, sponsor, deployer, member, maintainer, developer, + scripter, packager, explorer, infographile, manager + plugin_achievements_display: compact + plugin_achievements_threshold: X + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎩 Notable contributions - Contributions + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_notable: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎩 Notable contributions - Indepth analysis + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_notable: 'yes' + plugin_notable_indepth: 'yes' + plugin_notable_repositories: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💬 Discussions - GitHub Discussions + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_discussions: 'yes' + plugin_discussions_categories_limit: 8 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💭 GitHub Community Support - GitHub Community Support + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_support: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 👨‍💻 Lines of code changed - Lines of code changed + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + base: repositories + plugin_lines: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🧮 Repositories traffic - Repositories traffic + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_BOT_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📓 Repositories - Featured repositories + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_repositories: 'yes' + plugin_repositories_featured: lowlighter/metrics + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎫 Gists - Gists + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_gists: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🙋 Introduction - User introduction + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + user: github + base: header + plugin_introduction: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + token: ${{ secrets.METRICS_BOT_TOKEN }} + if: ${{ success() || failure() }} + - name: 🙋 Introduction - Repository introduction + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + template: repository + repo: metrics + base: header + plugin_introduction: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💕 GitHub Sponsors - Sponsors goal + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_sponsors: 'yes' + plugin_sponsors_sections: goal + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💕 GitHub Sponsors - Sponsors introduction + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_sponsors: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💫 Starlists - Featured star list + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_starlists: 'yes' + plugin_starlists_limit_repositories: 2 + plugin_starlists_only: 🤘 TC39 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🌇 GitHub Skyline 3D calendar - GitHub Skyline + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_skyline: 'yes' + plugin_skyline_year: 2020 + plugin_skyline_frames: 6 + plugin_skyline_quality: 1 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ⏱️ Website performances - Succint report + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_pagespeed: 'yes' + plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ⏱️ Website performances - Detailed report + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_pagespeed: 'yes' + plugin_pagespeed_detailed: 'yes' + plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ⏱️ Website performances - Screenshot + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_pagespeed: 'yes' + plugin_pagespeed_screenshot: 'yes' + plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Apple Music - Random track from playlist + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music: 'yes' + plugin_music_playlist: https://embed.music.apple.com/fr/playlist/usr-share/pl.u-V9D7m8Etjmjd0D + plugin_music_limit: 2 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Spotify - Random track from playlist + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music: 'yes' + plugin_music_playlist: https://open.spotify.com/embed/playlist/3nfA87oeJw4LFVcUDjRcqi + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Spotify - Recently listed + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music: 'yes' + plugin_music_provider: spotify + plugin_music_mode: recent + plugin_music_token: ${{ secrets.SPOTIFY_TOKENS }} + plugin_music_limit: 2 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Spotify - Top tracks + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music: 'yes' + plugin_music_mode: top + plugin_music_provider: spotify + plugin_music_token: ${{ secrets.SPOTIFY_TOKENS }} + plugin_music_time_range: short + plugin_music_top_type: tracks + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Spotify - Top artists + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music: 'yes' + plugin_music_mode: top + plugin_music_provider: spotify + plugin_music_token: ${{ secrets.SPOTIFY_TOKENS }} + plugin_music_time_range: long + plugin_music_top_type: artists + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Youtube Music - Random track from playlist + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music: 'yes' + plugin_music_playlist: >- + https://music.youtube.com/playlist?list=OLAK5uy_kU_uxp9TUOl9zVdw77xith8o9AknVwz9U + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Youtube Music - Recently listed + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music_token: ${{ secrets.YOUTUBE_MUSIC_TOKENS }} + plugin_music: 'yes' + plugin_music_mode: recent + plugin_music_provider: youtube + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🎼 Music plugin - Last.fm - Recently listed + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_music_token: ${{ secrets.LASTFM_TOKEN }} + plugin_music: 'yes' + plugin_music_provider: lastfm + plugin_music_user: RJ + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🗨️ Stackoverflow plugin - Top answers from stackoverflow + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_stackoverflow: 'yes' + plugin_stackoverflow_user: 1 + plugin_stackoverflow_sections: answers-top + plugin_stackoverflow_limit: 2 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: >- + 🌸 Anilist watch list and reading list - Favorites anime and currently + watching + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_anilist: 'yes' + plugin_anilist_medias: anime + plugin_anilist_sections: favorites, watching + plugin_anilist_limit: 1 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: >- + 🌸 Anilist watch list and reading list - Favorites manga and currently + reading + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_anilist: 'yes' + plugin_anilist_medias: manga + plugin_anilist_sections: favorites, reading + plugin_anilist_limit: 1 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🌸 Anilist watch list and reading list - Favorites characters + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_anilist: 'yes' + plugin_anilist_sections: characters + plugin_anilist_limit_characters: 22 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🐤 Latest tweets - Latest tweets + uses: lowlighter/metrics@master + with: + user: botlighter + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🐤 Latest tweets - Latest tweets including attachments + uses: lowlighter/metrics@master + with: + user: botlighter + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ✒️ Recent posts - Recent posts + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_posts: 'yes' + plugin_posts_source: dev.to + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ✒️ Recent posts - Recent posts with descriptions and cover images + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_posts: 'yes' + plugin_posts_source: dev.to + plugin_posts_descriptions: 'yes' + plugin_posts_covers: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 🗼 Rss feed - News from hackernews + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_rss: 'yes' + plugin_rss_source: https://news.ycombinator.com/rss + plugin_rss_limit: 4 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: ⏰ WakaTime plugin - WakaTime + uses: lowlighter/metrics@master + with: + plugin_wakatime_token: MOCKED_TOKEN + use_mocked_data: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 💹 Stock prices - Stock prices from Tesla + uses: lowlighter/metrics@master + with: + token: NOT_NEEDED + plugin_stock: 'yes' + plugin_stock_token: ${{ secrets.RAPIDAPI_TOKEN }} + plugin_stock_symbol: TSLA + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📸 Website screenshot - XKCD of the day + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + plugin_screenshot: 'yes' + plugin_screenshot_title: XKCD of the day + plugin_screenshot_url: https://xkcd.com + plugin_screenshot_selector: '#comic img' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📗 Classic template - Example + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + base: header, repositories + plugin_lines: 'yes' + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📘 Repository template - Example + uses: lowlighter/metrics@master + with: + template: repository + token: ${{ secrets.METRICS_BOT_TOKEN }} + user: lowlighter + repo: metrics + plugin_lines: 'yes' + plugin_followup: 'yes' + plugin_projects: 'yes' + plugin_projects_repositories: lowlighter/metrics/projects/1 + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📙 Terminal template - Example + uses: lowlighter/metrics@master + with: + template: terminal + token: ${{ secrets.METRICS_TOKEN }} + base: header, metadata + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📒 Markdown template - Example + uses: lowlighter/metrics@master + with: + template: markdown + markdown: metrics.markdown.template.md + config_output: markdown + token: ${{ secrets.METRICS_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📒 Markdown template - Example with plugins configuration for embed use + uses: lowlighter/metrics@master + with: + template: markdown + markdown: >- + https://raw.githubusercontent.com/lowlighter/metrics/master/source/templates/markdown/example.md + config_output: markdown + plugin_activity: 'yes' + plugin_activity_limit: 7 + plugin_activity_days: 0 + plugin_activity_filter: issue, pr, release, fork, review, ref/create + plugin_posts: 'yes' + plugin_posts_source: dev.to + plugin_posts_descriptions: 'yes' + plugin_posts_covers: 'yes' + plugin_posts_limit: 2 + plugin_rss: 'yes' + plugin_rss_source: https://news.ycombinator.com/rss + plugin_rss_limit: 4 + plugin_tweets: 'yes' + plugin_tweets_token: ${{ secrets.TWITTER_TOKEN }} + plugin_tweets_user: github + plugin_tweets_attachments: 'yes' + plugin_tweets_limit: 2 + plugin_topics: 'yes' + plugin_topics_limit: 24 + plugin_isocalendar: 'yes' + plugin_languages: 'yes' + token: ${{ secrets.METRICS_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📒 Markdown template - Example (pdf output) + uses: lowlighter/metrics@master + with: + template: markdown + markdown: >- + https://raw.githubusercontent.com/lowlighter/metrics/master/source/templates/markdown/example.pdf.md + config_output: markdown-pdf + plugin_rss: 'yes' + plugin_rss_source: https://news.ycombinator.com/rss + plugin_rss_limit: 4 + plugin_isocalendar: 'yes' + config_twemoji: 'yes' + config_padding: 5% + token: ${{ secrets.METRICS_TOKEN }} + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + - name: 📕 Community templates - Example + uses: lowlighter/metrics@master + with: + token: ${{ secrets.METRICS_TOKEN }} + template: '@classic' + setup_community_templates: lowlighter/metrics@master:classic + plugins_errors_fatal: 'yes' + output_action: none + delay: 120 + if: ${{ success() || failure() }} + + + - name: Publish examples + run: | + set +e + sudo mv /metrics_renders/* ./ + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git add --all + git commit -m "chore: update examples" + git push + +# ====================================================================================== +# Markdown as png (for readme updates) +# ====================================================================================== + + examples-markdown: + runs-on: ubuntu-latest + if: false + container: ghcr.io/lowlighter/metrics:master + needs: [examples] + steps: + - name: Screenshot markdown example + run: | + node /metrics/.github/scripts/markdown_example.mjs + echo "METRICS_MARKDOWN_EXAMPLE=$(base64 --wrap=0 metrics.markdown.png)" >> $GITHUB_ENV + - name: Update markdown example + uses: actions/github-script@v5 + env: + METRICS_MARKDOWN_EXAMPLE: "${{ env.METRICS_MARKDOWN_EXAMPLE }}" + with: + script: | + try { + const {data:{sha}} = await github.rest.repos.getContent({...context.repo, path:"metrics.markdown.png"}) + console.log(`current sha: ${sha}`) + github.rest.repos.createOrUpdateFileContents({ + ...context.repo, + path:"metrics.markdown.png", + message:`Auto-generated metrics for run #${github.context ? github.context.runId : "0000000000"}`, + content:process.env.METRICS_MARKDOWN_EXAMPLE, + sha, + }) + } catch (error) { console.log(error) } + +# ====================================================================================== +# Special job used to render lowlighter/metrics repository assets +# ====================================================================================== + + repository: + runs-on: ubuntu-latest + if: "github.repository == 'lowlighter/metrics'" + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Checkout examples + run: git checkout examples + + - name: Contributors + if: ${{ success() || failure() }} + uses: lowlighter/metrics@master + with: + filename: metrics.contributors.svg + token: ${{ secrets.METRICS_TOKEN }} + base: "" + template: repository + user: lowlighter + repo: metrics + plugin_people: yes + plugin_people_types: contributors + plugins_errors_fatal: yes + config_display: large + output_action: none + delay: 120 + - name: Sponsors + if: ${{ success() || failure() }} + uses: lowlighter/metrics@master + with: + filename: metrics.sponsors.svg + token: ${{ secrets.METRICS_TOKEN }} + base: "" + plugin_people: yes + plugin_people_types: sponsors + plugin_people_sponsors_custom: yutkat, ktnkk, iamsainikhil, tfSheol + plugin_people_size: 48 + plugins_errors_fatal: ${{ github.repository == 'lowlighter/lowlighter' }} + config_display: large + output_action: none + delay: 120 + - name: Licenses + if: ${{ success() || failure() }} + uses: lowlighter/metrics@master + with: + filename: metrics.licenses.svg + token: ${{ secrets.METRICS_TOKEN }} + base: "" + template: repository + repo: metrics + plugin_licenses: yes + plugin_licenses_setup: npm ci + plugin_licenses_legal: yes + plugin_licenses_ratio: yes + plugins_errors_fatal: ${{ github.repository == 'lowlighter/lowlighter' }} + output_action: none + delay: 120 + + - name: Publish examples + run: | + set +e + sudo mv /metrics_renders/* ./ + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git add --all + git commit -m "chore: update examples" + git push