From a5c965b1dfc9bf8ce9e3b50ac2c5de47756310e5 Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Fri, 7 Nov 2025 02:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(workflows):=20add=20notice=20b?= =?UTF-8?q?oard=20update=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - create new GitHub Actions workflow for automated notice board updates - trigger on pushes to config branch with specific YAML file changes - configure SSH signing for secure commits - fetch and execute Python script from gist to update README files - automatically commit and push changes to documentation files --- .github/workflows/notice-board.yml | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/notice-board.yml diff --git a/.github/workflows/notice-board.yml b/.github/workflows/notice-board.yml new file mode 100644 index 000000000..28a508dac --- /dev/null +++ b/.github/workflows/notice-board.yml @@ -0,0 +1,50 @@ +name: Update Notice Board + +on: + push: + branches: + - config + paths: + - .github/notice-board.yml + +jobs: + update-notice-board: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v5.0.0 + with: + fetch-depth: 0 + ref: ${{ github.ref }} + + - name: Configure SSH + uses: photostructure/git-ssh-signing-action@v1 + with: + ssh-signing-key: ${{ secrets.SSH_PRIVATE_KEY }} + git-user-name: ${{ github.actor }} + git-user-email: ${{ secrets.EMAIL }} + + - uses: actions/setup-python@main + with: + python-version: 3.x + pip-install: PyYAML requests + + - name: Run script + run: | + filename="update_notice_board.py" + raw_url=$(curl -s https://api.github.com/gists/${{ secrets.GIST_ID }} | jq -r .files.\"$filename\".raw_url) + curl -o /tmp/$filename -s $raw_url + python3 /tmp/$filename README.md + python3 /tmp/$filename README-en.md + + - name: Create Commit and Push + run: | + git add README.md README-en.md + if git diff --cached --quiet; then + echo "没有文件变更,跳过提交" + else + git commit --quiet "📝 docs(readme): update notice board" + fi + git push