Skip to content

Readme Credly Badges

一个自动更新 README 文件中 Credly 徽章详情的 Python GitHub Action。

ref-reporef-official-docref-dependent-action

用法

  1. 在仓库中创建一个 .github/workflows/ 目录。
  2. 添加 update-badges.yaml 文件,内容如下:
yaml
name: Update Credly Badges

on:
schedule:
  - cron: '0 0 * * *' # Runs daily at 00:00 UTC
workflow_dispatch: # Optional: allows manual trigger

permissions:
contents: write # Required if using the default GITHUB_TOKEN

jobs:
update-readme:
  name: Update README with Credly Badges
  runs-on: ubuntu-latest

  steps:
    - name: Update Badges in README
      uses: jd-35656/readme-credly-badges@v1
      with:
        credly_username: 'your-credly-username'
        github_token: ${{ secrets.GITHUB_TOKEN }}
  1. 在你的仓库中,创建或编辑 README.md 文件以包含:
markdown
## Credly Badges
<!-- START CREDLY BADGES -->
<!-- END CREDLY BADGES -->

参数

点击显示/关闭参数

名称类型必填默认值参数描述更多描述
ref-actions
credly_usernamestring{github.actor}你的 Credly 用户名
badge_sizestring150x150徽章大小 (例如,150x150, 680x680)
badge_sort_bystringissued徽章排序方式可选值:issued updated accepted
github_api_urlstringhttps://api.github.comGitHub API URL(用于 GitHub 企业版)。
github_tokenstringtrue{github.token}具有写入权限的令牌。
github_repostring{github.repository}目标 GitHub 仓库。
github_branchstringmain目标文件所在的分支。
readme_filestringREADME.md更新 markdown 文件的路径。
commit_messagestringUpdated README with new badges自定义提交信息。

示例

markdown
### Credly 徽章

<!-- START CREDLY BADGES -->
[![HashiCorp Certified: Terraform Associate (003)](https://images.credly.com/size/150x150/images/ed4be915-68f8-428a-b332-40ded9084ee5/blob)](https://www.credly.com/badges/9818630e-28f4-4541-964c-e79041c4d601)
[![AWS Certified DevOps Engineer – Professional](https://images.credly.com/size/150x150/images/bd31ef42-d460-493e-8503-39592aaf0458/image.png)](https://www.credly.com/badges/d557a8cd-735a-4abe-8f83-0f2e4f514a2c)
[![Red Hat System Administration II (RH134) - Ver. 9.0](https://images.credly.com/size/150x150/images/b9d7d72b-ff77-4bd0-af19-7cedff6f6ae3/Red_Hat_System_Administration_II.png)](https://www.credly.com/badges/06bb5e5a-8069-4d4d-9f39-d608dbf84cd3)
[![Red Hat System Administration I (RH124) - Ver. 9.0](https://images.credly.com/size/150x150/images/cefff7f2-8ca9-40a1-a5f8-17139fccb048/Red_Hat_System_Administration_I.png)](https://www.credly.com/badges/adfadf9c-8271-43d7-8edb-ae2370fe272d)
[![AWS Certified Developer – Associate](https://images.credly.com/size/150x150/images/b9feab85-1a43-4f6c-99a5-631b88d5461b/image.png)](https://www.credly.com/badges/0def91c4-2a33-47a9-90fb-0cbaaaaca301)
[![AWS Certified Cloud Practitioner](https://images.credly.com/size/150x150/images/00634f82-b07f-4bbd-a6bb-53de397fc3a6/image.png)](https://www.credly.com/badges/8cdd9a26-4452-410d-9d20-b351629dcf75)
[![AWS Partner: Technical Accredited](https://images.credly.com/size/150x150/images/a253b994-caa6-4dd1-bf0e-434dd012b1f6/image.png)](https://www.credly.com/badges/3ccfe59f-8525-4b35-bacb-d5955486bef4)
<!-- END CREDLY BADGES -->

Credly 徽章

HashiCorp Certified: Terraform Associate (003) AWS Certified DevOps Engineer – Professional Red Hat System Administration II (RH134) - Ver. 9.0 Red Hat System Administration I (RH124) - Ver. 9.0 AWS Certified Developer – Associate AWS Certified Cloud Practitioner AWS Partner: Technical Accredited

Readme Widget Hub (v4.3.0) MIT Licensed