|
1 | 1 | name: tlAI-linter |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - master |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - dev |
7 | 8 |
|
8 | 9 | jobs: |
9 | | - linting: |
10 | | - name: tlAI-linter |
11 | | - |
12 | | - runs-on: ubuntu-latest |
13 | | - |
14 | | - env: |
15 | | - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
16 | | - OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }} |
17 | | - OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }} |
18 | | - |
19 | | - defaults: |
20 | | - run: |
21 | | - shell: bash |
22 | | - |
23 | | - steps: |
24 | | - - name: Clone repo |
25 | | - uses: actions/checkout@v4 |
26 | | - with: |
27 | | - ## All history for git diff below to succeed. |
28 | | - fetch-depth: 0 |
29 | | - |
30 | | - - name: Setup NodeJS |
31 | | - ## https://github.com/actions/setup-node |
32 | | - uses: actions/setup-node@v4 |
33 | | - with: |
34 | | - node-version: "20" |
35 | | - |
36 | | - - name: Run GenAIscript on the TLA+ specs that are added in this pull request. |
37 | | - ## Identify git diff: $(git diff --name-only HEAD^ | grep '.tla') |
38 | | - ## Install genaiscript runtime: https://microsoft.github.io/genaiscript/reference/cli/ |
39 | | - ## Output LLM response in SARIF format: https://microsoft.github.io/genaiscript/reference/scripts/annotations/ |
40 | | - run: npx --yes genaiscript run .github/scripts/tlAI-Linter.genai.js $(git diff --name-only HEAD^ | grep '.tla') -oa results.sarif |
41 | | - |
42 | | - - name: Upload SARIF file |
43 | | - ## https://sarifweb.azurewebsites.net |
44 | | - ## https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github |
45 | | - if: success() || failure() |
46 | | - uses: github/codeql-action/upload-sarif@v3 |
47 | | - with: |
48 | | - sarif_file: results.sarif |
| 10 | + linting: |
| 11 | + name: tlAI-linter |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + env: |
| 16 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 17 | + OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }} |
| 18 | + OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }} |
| 19 | + |
| 20 | + defaults: |
| 21 | + run: |
| 22 | + shell: bash |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Clone repo |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + ## All history for git diff below to succeed. |
| 29 | + fetch-depth: 0 |
| 30 | + |
| 31 | + - name: Setup NodeJS |
| 32 | + ## https://github.com/actions/setup-node |
| 33 | + uses: actions/setup-node@v4 |
| 34 | + with: |
| 35 | + node-version: "20" |
| 36 | + |
| 37 | + - name: Run GenAIscript on the TLA+ specs that are added in this pull request. |
| 38 | + ## Identify git diff: $(git diff --name-only HEAD^ | grep '.tla') |
| 39 | + ## Install genaiscript runtime: https://microsoft.github.io/genaiscript/reference/cli/ |
| 40 | + ## Output LLM response in SARIF format: https://microsoft.github.io/genaiscript/reference/scripts/annotations/ |
| 41 | + run: npx --yes genaiscript run .github/scripts/tlAI-Linter.genai.js $(git diff --name-only HEAD^ | grep '.tla') -oa results.sarif |
| 42 | + |
| 43 | + - name: Upload SARIF file |
| 44 | + ## https://sarifweb.azurewebsites.net |
| 45 | + ## https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github |
| 46 | + if: success() || failure() |
| 47 | + uses: github/codeql-action/upload-sarif@v3 |
| 48 | + with: |
| 49 | + sarif_file: results.sarif |
0 commit comments