-
Notifications
You must be signed in to change notification settings - Fork 280
76 lines (54 loc) · 2.22 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: autofix.ci # needed to securely identify the workflow
on:
pull_request:
paths: ["**.json", "**.cpp", "**.hpp", "**.h", "**.c", "**.md", "**.ts"]
permissions:
contents: read
env:
DENO_DIR: '~/.cache/deno'
jobs:
autofix:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install astyle
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: cache deno dependencies
uses: actions/cache@v3
with:
path: ${{ env.DENO_DIR }}
key: deno-${{ hashFiles('deno.lock') }}
- name: format C++ files
run: make astyle
- name: format Markdown and TypeScript files
run: deno fmt
- name: format Lua files
run: deno task dprint fmt
- name: format JSON
run: make style-all-json-parallel RELEASE=1
- uses: autofix-ci/action@bee19d72e71787c12ca0f29de72f2833e437e4c9
if: ${{ always() }}
with:
commit-message: "style(autofix.ci): automated formatting"
comment: |
Autofix has formatted [code style violation][code-style] in this PR.
<details><summary>I edit commits locally (e.g: git, github desktop) and want to keep autofix</summary>
1. Run `git pull`. this will merge the automated commit into your local copy of the PR branch.
2. Continue working.
</details>
<details><summary>I do not want the automated commit</summary>
1. [Format your code locally](https://docs.cataclysmbn.org/en/contribute/contributing/#code-style), then commit it.
2. Run `git push --force` to force push your branch. This will overwrite the automated commit on remote with your local one.
3. Continue working.
</details>
If you don't do this, your following commits will be based on the old commit, and cause **MERGE CONFLICT**.
[code-style]: https://docs.cataclysmbn.org/en/contribute/contributing/#code-style
- name: lint and test typescript files
run: |
deno lint
deno test
deno run --allow-read --allow-write scripts/semantic.ts