Skip to content

Commit 2e6ffd8

Browse files
committed
ltex workflow
1 parent 17a7133 commit 2e6ffd8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/ltex.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: ltex
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
steps:
13+
- name: Checking out repository
14+
uses: actions/checkout@v4
15+
- name: Install ltex-ls
16+
run: brew install ltex-ls
17+
- name: Run ltex-ls
18+
id: run-ltex-ls
19+
run: |
20+
ltex-cli --client-configuration=paper/ltex.json paper | tee ltex-cli.log
21+
- name: Build comment
22+
id: build-comment
23+
uses: actions/github-script@v6
24+
with:
25+
github-token: ${{ github.token }}
26+
result-encoding: string
27+
script: |
28+
const fs = require('fs');
29+
return "<details>\n<summary>ltex output</summary>\n\n```\n" + fs.readFileSync("${{ github.workspace }}/ltex-cli.log", "utf8").toString() + "\n```\n</details>";
30+
- name: Comment in PR
31+
uses: thollander/actions-comment-pull-request@v2
32+
with:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
message: ${{ steps.build-comment.outputs.result }}

0 commit comments

Comments
 (0)