From 56ca64fcfb19839fff5df4509af3836859e33ada Mon Sep 17 00:00:00 2001 From: Yaosanqi137 <99163721+Yaosanqi137@users.noreply.github.com> Date: Mon, 1 Dec 2025 20:52:14 +0800 Subject: [PATCH] Create workflow to update organization members This workflow updates the organization members list on a scheduled basis or via manual dispatch. It checks out the repository, sets up Python, installs dependencies, runs a script to update members, and commits the changes. --- workflows/update-members.yml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 workflows/update-members.yml diff --git a/workflows/update-members.yml b/workflows/update-members.yml new file mode 100644 index 0000000..e9c3c07 --- /dev/null +++ b/workflows/update-members.yml @@ -0,0 +1,40 @@ +name: Update Organization Members + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + contents: write # 配合 fine-grained token 或者是 GITHUB_TOKEN 的默认写权限 + +jobs: + update-readme: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install Dependencies + run: pip install requests + + - name: Update Members Script + env: + # 这里使用的是你刚刚生成的 Fine-grained Token + GH_TOKEN: ${{ secrets.ORG_READ_TOKEN }} + ORG_NAME: ${{ github.repository_owner }} + run: python scripts/update_members.py + + - name: Commit and Push Changes + # 如果使用 Fine-grained Token 更新内容,git-auto-commit-action 通常需要明确指定 token + # 或者直接使用默认的 GITHUB_TOKEN 进行提交(如果不需要触发其他流程) + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "docs: update organization members list" + branch: main + file_pattern: "/profile/README.md"