這個功能主要是用的這個開源倉庫:https://github.com/yoshi389111/github-profile-3d-contrib
想看效果的話,我的個人主頁:https://github.com/Sjj1024
開始操作
1.創建自己的github主頁屬性項目——跟你github用戶名一致即可, 比如我github名字叫是sjj1024, 創建一個sjj1024的同名項目,勾選生成README.md文件。
2. 開啟Action的讀寫權限,勾選后保存即可:
-?Settings -> Action -> General -> Workflow permissions
-?read and write permissions
3. 創建WorkFlow文件:
- 項目Action里面點擊創建一個WorkFlow文件,名字叫Profile3D
文件內容如下:
name: GitHub-Profile-3D-Contribon:schedule: # 03:00 JST == 18:00 UTC- cron: "0 18 * * *"workflow_dispatch:jobs:build:runs-on: ubuntu-latestname: generate-github-profile-3d-contribsteps:- uses: actions/checkout@v3- uses: yoshi389111/github-profile-3d-contrib@0.7.1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}USERNAME: ${{ github.repository_owner }}- name: Commit & Pushrun: |git config user.name github-actionsgit config user.email github-actions@github.comgit add -A .git commit -m "generated"git push
然后手動執行一次 action:Actions
? ->?GitHub-Profile-3D-Contrib
? ->?Run workflow
?
然后會在項目目錄種生成這些文件(帶路徑,各種主題的都有):
profile-3d-contrib/profile-green-animate.svg
?profile-3d-contrib/profile-green.svg
?profile-3d-contrib/profile-season-animate.svg
?profile-3d-contrib/profile-season.svg
?profile-3d-contrib/profile-south-season-animate.svg
?profile-3d-contrib/profile-south-season.svg
?profile-3d-contrib/profile-night-view.svg
?profile-3d-contrib/profile-night-green.svg
?profile-3d-contrib/profile-night-rainbow.svg
?profile-3d-contrib/profile-gitblock.svg
?
然后在README.md里面引入:

最后的效果如下:?