-
-
Notifications
You must be signed in to change notification settings - Fork 480
45 lines (37 loc) · 1.48 KB
/
autofix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci".
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- "!.github/workflows/ci.yml"
- "!.github/actions/clone-submodules/action.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
with:
restore-cache: false
tools: just,cargo-shear@1,dprint
components: rustfmt
- name: Restore dprint plugin cache
id: cache-restore
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
key: dprint-autofix-ci-${{ runner.os }}-${{ hashFiles('dprint.json') }}
path: ~/.cache/dprint
- run: just fmt
- uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1
with:
fail-fast: false
- name: Save dprint plugin cache
if: ${{ github.ref_name == 'main' }}
id: cache-save
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
path: ~/.cache/dprint