mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
* fix(ci): use open-design-bot for metrics PRs * fix(ci): restore metrics workflow app scopes Generated-By: looper 0.0.0-dev (runner=fixer, agent=opencode)
81 lines
2.8 KiB
YAML
81 lines
2.8 KiB
YAML
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
|