Skip to content

Commit 505dd6c

Browse files
committed
Generate PR suggestions when formatting is wrong
This should make it much easier to do drive-by changes in the GitHub editor: the comment should contain a diff that can be committed directly from the online editor.
1 parent 7a25c4a commit 505dd6c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: .github/workflows/build.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ jobs:
2121
run: |
2222
sudo apt update
2323
sudo apt install gettext yapf3
24+
curl -fsSL https://dprint.dev/install.sh | sh
25+
echo "/home/runner/.dprint/bin" >> $GITHUB_PATH
2426
2527
- name: Install nightly rustfmt
2628
run: |
2729
rustup default nightly
2830
rustup component add rustfmt
2931
30-
- name: Check formatting
31-
uses: dprint/[email protected]
32+
- name: Reformat
33+
run: dprint fmt
34+
35+
- uses: parkerbxyz/suggest-changes@v1
36+
37+
- name: Check if there were any changes
38+
run: git diff --exit-code
3239

3340
typos:
3441
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)