透過 GitHub Actions 自動抓取自己寫的 CodeLove 文章,並更新專案根目錄的 README.md
.github/workflows/codelove-updater.yml
在專案中:name: Test Codelove Blog Updater
# You can modify the workflow to run on different events
on:
workflow_run:
workflows: ['Build Action']
types:
- completed
branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
test-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test Codelove Blog Updater
uses: jaosn60810/readme-codelove-list@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 換成自己的 USERNAME
CODELOVE_USERNAME: 'XXX'
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'test: update README with latest blog posts'
add: 'README.md'
## Latest Blog Posts
<!-- UPDATE_CODELOVE:START -->
文章會列在這裡
<!-- UPDATE_CODELOVE:END -->