diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f8dc116c4..f438b4c1ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,8 +51,24 @@ jobs: npm install --include=dev - name: Prettier check - run: | - npm run check + id: prettier + run: npm run check + - name: Prettier fix + if: "failure() && steps.prettier.outcome == 'failure'" + run: npm run fix + - name: Submit PR for prettier fix + if: "failure() && steps.prettier.outcome == 'failure' && github.ref == 'refs/heads/master'" + uses: peter-evans/create-pull-request@v5 + with: + commit-message: 'Prettier auto fix from GitHub Actions run ${{ github.run_number }}' + branch: prettier-auto-fix + delete-branch: true + title: 'Fix Prettier formatting from GitHub Actions run ${{ github.run_number }}' + body: | + Attempt to automatically fix Prettier formatting issues in ${{ github.sha }}. + + This PR is generated by GitHub Actions run ${{ github.run_number }}. + assignees: '${{ github.actor }}' - name: Prepare build if: github.ref == 'refs/heads/master' diff --git a/README.md b/README.md index 8aa6649e71..ac2f104f6c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # LUG @ USTC 新版网站 -中国科学技术大学 Linux 用户协会的官方网站。(于 2020 年 8 月启用,所以称为“新版”) +中国科学技术大学Linux用户协会的官方网站。(于 2020 年 8 月启用,所以称为“新版”) 本仓库为源代码,所有推送到 master 分支的修改会使用 GitHub Actions 自动编译和部署。