From 681b65815a551a383625ddbf1e7f6578ce6ea43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Fri, 13 Dec 2024 16:30:05 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=87=AA=E5=8A=A8=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=8A=93=E5=8F=96=E7=9A=84=20issues=20md=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/static.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 97e0311..0608a8e 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -5,6 +5,11 @@ on: # Runs on pushes targeting the default branch push: branches: ["main"] + paths: + - 'docs/**' # Only trigger on changes in the docs directory + # Runs on issue events + issues: + types: [opened, edited, reopened] # Specify events you're interested in # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -46,6 +51,26 @@ jobs: run: | npm run docs:build + - name: Check for changes + id: check_changes + run: | + if [ -n "$(git diff docs/issues)" ]; then + echo "changed=true" >> $GITHUB_OUTPUT + else + echo "changed=false" >> $GITHUB_OUTPUT + fi + continue-on-error: true + + # Optionally, customize the user name and commit message, and can add an email as well such as Github Actions' email + - name: Set up Git and Commit Changes + run: | + if [ "${{ steps.check_changes.outputs.changed }}" == "true" ]; then + git config --local user.name "Issues Docs [BOT]" + git add . + git commit -m "Auto-Generate docs 🤖" + git push + fi + - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact