update my profile #128
This file contains 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: update my profile | |
on: | |
# 每日触发 | |
schedule: | |
- cron: "0 0 * * *" | |
# 允许手动触发 | |
workflow_dispatch: | |
jobs: | |
generate-python-svg2repo: | |
permissions: | |
# 给程序读写仓库的权限 | |
contents: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
# pull 拉取仓库,创建.git | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# 生成吃掉我个人贡献图的 Python | |
- name: generate github-contribution-grid-snake.svg | |
uses: Platane/snk/svg-only@v3 | |
with: | |
github_user_name: ${{ github.repository_owner }} | |
outputs: | | |
python-eat-contribution.svg?color_snake=blue | |
python-eat-contribution-dark.svg?palette=github-dark&color_snake=blue | |
# 推送svg到仓库 | |
- name: Commit & Push changes | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add python-eat-contribution.svg python-eat-contribution-dark.svg | |
git commit -m "Update python-eat-contribution SVGs" || echo "No changes to commit" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用GITHUB_TOKEN进行身份验证 |