Skip to content

Commit

Permalink
Produce an auto PR in case of Prettier failure
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Dec 15, 2023
1 parent f732c58 commit 2988303
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LUG @ USTC 新版网站

中国科学技术大学 Linux 用户协会的官方网站。(于 2020 年 8 月启用,所以称为“新版”)
中国科学技术大学Linux用户协会的官方网站。(于 2020 年 8 月启用,所以称为“新版”)

本仓库为源代码,所有推送到 master 分支的修改会使用 GitHub Actions 自动编译和部署。

Expand Down

0 comments on commit 2988303

Please sign in to comment.