From c6647ae1e903271a092ae78506082ac506d4898b Mon Sep 17 00:00:00 2001 From: ootr Date: Sat, 2 Nov 2024 01:07:29 +0900 Subject: [PATCH] =?UTF-8?q?PR=E6=99=82=E3=81=AB=E8=87=AA=E5=8B=95=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr_test_format.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_test_format.yml b/.github/workflows/pr_test_format.yml index 10ceeba..96e8cf2 100644 --- a/.github/workflows/pr_test_format.yml +++ b/.github/workflows/pr_test_format.yml @@ -1,9 +1,11 @@ -name: PR Format Check +name: PR Format on: pull_request: branches: - master + paths: + - "**/*.md" jobs: format-check: @@ -19,5 +21,16 @@ jobs: - name: Install dependencies run: npm install - - name: Run Prettier check - run: npx prettier --check "./**/*.md" + - name: Run Prettier format + run: npx prettier --write "./**/*.md" + + - name: Check for changes + id: git_diff + run: | + git diff --exit-code || echo "changes" + + - uses: stefanzweifel/git-auto-commit-action@v3.0.0 + if: steps.git_diff.outputs.changes == 'changes' + with: + commit_message: Apply Prettier Change + ref: ${{ github.head_ref }}