From 28dbb170f0e5cde57bf05140b6b15b821d5b6c88 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 17:11:41 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7585238..44ca2a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ book +node -- 2.40.1 From 3243cac60619dd2e7516f81f954a45ca9176e955 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 17:19:46 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 60 ++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index bd304ad..b0672ca 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -3,6 +3,65 @@ run-name: Build and Publish book (${{ gitea.actor }}) on: [push] jobs: + Format: + runs-on: ubuntu-latest + steps: + - name: Info + run: echo "OS=${{ runner.os }} NAME=${{ gitea.event_name }} REPO=${{ gitea.repository }} BRANCH=${{ gitea.ref }} ST=${{ job.status }} RUNID=${{ gitea.run_id }}" + - name: Checkout + uses: https://git.hmtsai.cn/actions/checkout@v4 + - name: Cache Node + uses: https://git.hmtsai.cn/actions/cache@v4 + id: cache-node + env: + cache-name: cache-node + with: + key: ${{ runner.os }}-node + path: | + /node + - name: Prepare node + if: ${{ steps.cache-node.outputs.cache-hit != 'true' }} + run: | + git clone https://git.hmtsai.cn/cxykevin/study-area-home-action-deps + mv study-area-home-action-deps/node-$(uname -m).tar.xz study-area-home-action-deps/node.tar.xz + tar xvJf study-area-home-action-deps/node.tar.xz + mv node-*-linux-* /node + export PATH=/node/bin:$PATH + echo $PATH + - name: Get npm root + id: npm_root + run: echo "::set-output name=npmroot::$(npm root -g)" + - name: Cache Node Moudles + id: cache-node-moudles + uses: https://git.hmtsai.cn/actions/cache@v4 + env: + cache-name: cache-node-moudles + with: + key: ${{ runner.os }}-node_moudles + path: | + ${{ steps.npm_root.outputs.npmroot }} + - name: Check node + run: | + node -v + npm -v + - name: Prepare NPM source + run: | + export PATH=/node/bin:$PATH + npm config set registry https://registry.npmmirror.com + - name: npm install + if: ${{ steps.cache-node-moudles.outputs.cache-hit != 'true' }} + run: | + export PATH=/node/bin:$PATH + npm install -g @lint-md/cli + - name: Format + run: | + export PATH=/node/bin:$PATH + lint-md src/**/* --threads=8 --fix --suppress-warnings + - name: Commit files + run: | + git add . + git commit -m 'Auto format' + git push Run: runs-on: ubuntu-latest steps: @@ -66,4 +125,3 @@ jobs: run: | mv book index lftp ${{ secrets.FTP_SITE }} -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PWD }} -e "mirror -R index index" - -- 2.40.1 From 8731fdc653df70ca8406348bf6910de51b86ea84 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 19:09:46 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 44ca2a5..0e06202 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ book node +study-area-home-action-deps -- 2.40.1 From 7d9ea421db8c1d996b6665295fa1e806422e799c Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 19:10:15 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0e06202..ee8a37e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ book node study-area-home-action-deps +study-area-action-deps -- 2.40.1 From 35cabd3b9d217c44941fa6ace67edcbb313ae221 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 20:36:41 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b0672ca..37310cc 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -59,9 +59,11 @@ jobs: lint-md src/**/* --threads=8 --fix --suppress-warnings - name: Commit files run: | + git config --global user.name "studyareacn-format-bot" + git config --global user.email studyareacn-format@noreply.localhost" git add . git commit -m 'Auto format' - git push + git push -u {{ secrets.GIT_USER }}:{{ secrets.PASSWD }} Run: runs-on: ubuntu-latest steps: -- 2.40.1 From 0e68cc2a33cb4fce3794198f9a8078d4b135f1fe Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 20:43:20 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 37310cc..6eb4fc9 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -60,7 +60,7 @@ jobs: - name: Commit files run: | git config --global user.name "studyareacn-format-bot" - git config --global user.email studyareacn-format@noreply.localhost" + git config --global user.email "studyareacn-format@noreply.localhost" git add . git commit -m 'Auto format' git push -u {{ secrets.GIT_USER }}:{{ secrets.PASSWD }} -- 2.40.1 From a27718d687b7a01b532f2e5aaa8c954cf3ad5bd7 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 20:49:51 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 6eb4fc9..132111c 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -62,8 +62,8 @@ jobs: git config --global user.name "studyareacn-format-bot" git config --global user.email "studyareacn-format@noreply.localhost" git add . - git commit -m 'Auto format' - git push -u {{ secrets.GIT_USER }}:{{ secrets.PASSWD }} + git commit -m "Auto format" + git push -u {{ secrets.GIT_USER }}:{{ secrets.GIT_PASSWD }} Run: runs-on: ubuntu-latest steps: -- 2.40.1 From bb9d8bb4fea1d9b3f3b085e1708bfedf52f14aa9 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 20:54:33 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 132111c..519d58e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -63,7 +63,7 @@ jobs: git config --global user.email "studyareacn-format@noreply.localhost" git add . git commit -m "Auto format" - git push -u {{ secrets.GIT_USER }}:{{ secrets.GIT_PASSWD }} + git push -u ${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWD }} Run: runs-on: ubuntu-latest steps: -- 2.40.1 From 43623781f81e95d5c321dc1d14c2bf2c2f5676e5 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 7 Jul 2024 21:03:23 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/build?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 519d58e..4529339 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -61,9 +61,10 @@ jobs: run: | git config --global user.name "studyareacn-format-bot" git config --global user.email "studyareacn-format@noreply.localhost" + git remote set-url origin https://${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWD }}@git.hmtsai.cn/study-area-cn/study-area-cn git add . git commit -m "Auto format" - git push -u ${{ secrets.GIT_USER }}:${{ secrets.GIT_PASSWD }} + git push Run: runs-on: ubuntu-latest steps: -- 2.40.1