-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: ltex | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checking out repository | ||
uses: actions/checkout@v4 | ||
- name: Install ltex-ls | ||
run: | | ||
brew install openjdk@17 ltex-ls | ||
sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk | ||
- name: Run ltex-ls | ||
id: run-ltex-ls | ||
run: | | ||
ltex-cli --client-configuration=paper/ltex.json paper | tee ltex-cli.log | ||
- name: Build comment | ||
id: build-comment | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ github.token }} | ||
result-encoding: string | ||
script: | | ||
const fs = require('fs'); | ||
return "<details>\n<summary>ltex output</summary>\n\n```\n" + fs.readFileSync("${{ github.workspace }}/ltex-cli.log", "utf8").toString() + "\n```\n</details>"; | ||
- name: Comment in PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
message: ${{ steps.build-comment.outputs.result }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters