Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions .github/workflows/format-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Format docs on PR with Prettier
name: Format docs with Prettier

on:
# https://stackoverflow.com/a/58740879
pull_request_target:
push:
branches: [main]

jobs:
Expand All @@ -11,25 +10,35 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PR_OP_GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
submodules: 'recursive'

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: 'lts/*'

- name: Install dependencies
run: npm i -g prettier

- name: Format code with Prettier
run: npx prettier -cw .

- name: Check diff
id: check-diff
run: |
EXIT_CODE=0
git diff --quiet --exit-code || EXIT_CODE=$?
if [ $EXIT_CODE -eq 1 ]; then
echo "has_diff=true" >> $GITHUB_OUTPUT
else
echo "has_diff=false" >> $GITHUB_OUTPUT
fi

- name: Commit and push changes
if: steps.check-diff.outputs.has_diff == 'true'
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "style: format code with prettier [skip ci]" && git push)
git commit -m "style: format code with prettier [skip ci]"
git push
4 changes: 2 additions & 2 deletions DeviceReports/marble.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
| RyoamicLights | ✅(0.2.11) |
| TouchController | ✅(0.1.5) |
| Physics Mod Pro | ✅(v172b) |
| Distant Horizons | ✅(2.3.0-b, 需启用 ANGLE) |
| Distant Horizons | ✅(2.3.0-b, 需启用 ANGLE) |
| Modern UI | ✅(3.11.1.9) |
| Immersive Portals Continued | \*️⃣(6.0.7, 无法渲染传送门) |
| Immersive Portals Continued | \*️⃣(6.0.7, 无法渲染传送门) |

## Shaderpack compatibility

Expand Down
2 changes: 1 addition & 1 deletion DeviceReports/sagit.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
| Physics Mod Pro | ✅(v172b) |
| Distant Horizons | ❌(2.3.0-b) |
| Modern UI | ✅(3.11.1.9) |
| Immersive Portals Continued | \*️⃣(6.0.7, 无法渲染传送门) |
| Immersive Portals Continued | \*️⃣(6.0.7, 无法渲染传送门) |

## Shaderpack compatibility

Expand Down
Loading