ohpm-dashboard

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

README

ohpm-dashboard

Example: Example.md

Setup 💻

1.Add comments to the place where you want to update in the markdown file.

  • Table
<!-- md:OHPMDashboard begin --><!-- md:OHPMDashboard end -->
  • Package total
<!-- md:OHPMDashboard-total begin --><!-- md:OHPMDashboard-total end -->

2.Enable read/write permissions

(recommend) If you use a Personal access token:

e.g. github_token: ${{ secrets.xxxxxx }} (ghp_xxxxx)
Create a token (enable repo permissions) https://github.com/settings/tokens/

If you use the current repo's token:

e.g. github_token: ${{ secrets.GITHUB_TOKEN }}
https://docs.github.com/en/actions/security-guides/automatic-token-authentication
Current repo's settings: Settings -> Actions -> General -> Workflow permissions -> Read and write permissions

3.Edit the settings in .github/workflows/ohpm-dashboard.yml

...

jobs:
  ohpm-dashboard-job:
    runs-on: ubuntu-latest
    name: ohpm-dashboard
    steps:
      - name: run ohpm-dashboard
        uses: AmosHuKe/ohpm-dashboard@v1
        with:
          github_token: ${{ Personal access token }} or ${{ secrets.GITHUB_TOKEN }}
          github_repo: "https://github.com/AmosHuKe/ohpm-dashboard"
          filename: "Example.md"
          publisher_list: "6542179b6dad4e55f6635764" # https://ohpm.openharmony.cn/#/cn/publisher/6542179b6dad4e55f6635764
          package_list: "@candies/extended_text,@bb/xx,@cc/xx"
          sort_field: "publishTime"
          sort_mode: "asc"

...
Setting Default Value Description
github_token required - - Github Token with repo permissions
github_repo required - - Github repo to be manipulated
commit_message docs(ohpm-dashboard): ohpm-dashboard has updated readme - Commit message
committer_username github-actions[bot] - Committer username
committer_email 41898282+github-actions[bot]@users.noreply.github.com - Committer email
filename README.md - Markdown file
e.g. "README.md" "test/test.md"
publisher_list - - Publisher ID (, split)
https://ohpm.openharmony.cn/#/cn/publisher/6542179b6dad4e55f6635764
e.g. "6542179b6dad4e55f6635764,xxx,xxx"
package_list - - Package name (, split)
e.g. "@candies/extended_text,@bb/xx,@cc/xx"
sort_field name name, publishTime, ohpmLikes, ohpmDownloads, githubStars Sort field
sort_mode asc asc, desc Sort mode

Tips 💡

  • ⁉️: Package not found
  • publisher_list and package_list are merged
  • The Github link is parsed by the Homepage, Repository of ohpm.openharmony.cn

Thanks Shields.

License 📄

Open sourced under the Apache-2.0.

© AmosHuKe

Documentation

Overview

ohpm.openharmony.cn Package 仪表盘

识别并更新指定 [filename] Markdown 文件中的特定占位内容,

特定占位:

  • `<!-- md:OHPMDashboard begin --><!-- md:OHPMDashboard end -->` 仪表盘表格(Markdown 格式)
  • `<!-- md:OHPMDashboard-total begin --><!-- md:OHPMDashboard-total end -->` Package 数量

使用:

  • `go run main.go -githubToken xxx -filename xxx -publisherList xxx -packageList xxx -sortField xxx -sortMode xxx`

参数:

  • [githubToken] 拥有 repo 权限的 Github 令牌
  • [filename] 需要更新的 Markdown 文件,例如:"README.md" "test/test.md"
  • [publisherList] Publisher ID 列表 (`,`逗号分割) https://ohpm.openharmony.cn/#/cn/publisher/6542179b6dad4e55f6635764 例如:"6542179b6dad4e55f6635764,xxx,xxx"
  • [packageList] Package 名称列表 (`,`逗号分割),例如:"@candies/extended_text,@bb/xx,@cc/xx"
  • [sortField] 排序字段 可选:name(default) | publishTime | ohpmLikes | ohpmDownloads | githubStars
  • [sortMode] 排序方式 可选:asc(default) | desc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL