github-metrics #36
This file contains hidden or 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
| name: github-metrics | |
| on: | |
| schedule: | |
| # Runs daily at 00:15 UTC; output is committed to docs/assets/github-metrics.svg. | |
| - cron: '15 0 * * *' | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/metrics.yml | |
| permissions: | |
| contents: read | |
| jobs: | |
| metrics: | |
| name: Generate repository metrics SVG | |
| if: github.repository == 'nexu-io/open-design' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate Open Design bot token | |
| id: open-design-bot-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.BOT_APP_ID }} | |
| private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }} | |
| owner: nexu-io | |
| repositories: open-design | |
| permission-administration: read | |
| permission-contents: write | |
| permission-issues: read | |
| permission-pull-requests: write | |
| - name: Generate GitHub repository metrics | |
| uses: lowlighter/metrics@latest | |
| with: | |
| # Output path; the action opens/updates a PR when this file changes. | |
| # Requires manual review to merge. If metrics unchanged, no PR is created. | |
| filename: docs/assets/github-metrics.svg | |
| # Auth: use the Open Design GitHub App so generated commits and pull | |
| # requests come from open-design-bot[bot] and trigger normal PR CI. | |
| token: ${{ steps.open-design-bot-token.outputs.token }} | |
| committer_token: ${{ steps.open-design-bot-token.outputs.token }} | |
| committer_message: Update ${filename} | |
| output_action: pull-request | |
| output_condition: data-changed | |
| # Use the repository template (per-repo metrics, not user metrics). | |
| # Organization-owned repositories must be targeted explicitly, otherwise | |
| # lowlighter/metrics infers the token owner and treats the target as an org. | |
| template: repository | |
| base: '' | |
| user: nexu-io | |
| repo: open-design | |
| # Plugins. Anything that requires a personal token will silently no-op | |
| # without METRICS_TOKEN — the rest still produce a useful SVG. | |
| plugin_contributors: yes | |
| plugin_contributors_categories: | | |
| { | |
| "Skills": "skills/**", | |
| "Design systems": "design-systems/**", | |
| "Web": "apps/web/**", | |
| "Daemon": "apps/daemon/**", | |
| "Docs": "docs/**" | |
| } | |
| plugin_followup: yes | |
| plugin_followup_sections: pr, issue | |
| plugin_languages: yes | |
| plugin_languages_details: lines, percentage | |
| plugin_languages_limit: 8 | |
| plugin_lines: yes | |
| plugin_traffic: yes | |
| plugin_stargazers: yes | |
| plugin_stargazers_charts_type: chartist | |
| config_timezone: Asia/Shanghai | |
| config_display: large |