1
1
name : Trigger Docs Samples Rebuild
2
2
permissions :
3
3
contents : read
4
+ pull-requests : read
4
5
5
6
on :
6
7
push :
@@ -16,15 +17,23 @@ jobs:
16
17
- name : Checkout code
17
18
uses : actions/checkout@v4
18
19
20
+ - name : Get list of changed files
21
+ id : changed
22
+ run : |
23
+ files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep '\.py$' || true)
24
+ echo "files=$files" >> "$GITHUB_OUTPUT"
25
+
19
26
- name : Run Ruff linter
20
27
uses : astral-sh/ruff-action@v1
21
28
with :
22
- args : check ./samples
29
+ args : check
30
+ src : ${{ steps.changed.outputs.files }}
23
31
24
32
- name : Run Ruff formatter check
25
33
uses : astral-sh/ruff-action@v1
26
34
with :
27
35
args : " format --check"
36
+ src : ${{ steps.changed.outputs.files }}
28
37
29
38
js-ts-lint :
30
39
runs-on : ubuntu-latest
37
46
with :
38
47
node-version : ' 20'
39
48
49
+ - name : Get list of changed JS/TS files
50
+ id : changed_js
51
+ run : |
52
+ files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep -E '\.(js|ts|jsx|tsx)$' || true)
53
+ echo "files=$files" >> "$GITHUB_OUTPUT"
54
+
40
55
- name : Run ESLint (JS/TS only)
41
- run : npx eslint "samples/**/*.{js,ts,jsx,tsx}"
56
+ run : |
57
+ if [ -n "${{ steps.changed_js.outputs.files }}" ]; then
58
+ npx eslint ${{ steps.changed_js.outputs.files }}
59
+ else
60
+ echo "No JS/TS files to lint."
61
+ fi
62
+
63
+ - name : Run Prettier check (JS/TS only)
64
+ run : |
65
+ if [ -n "${{ steps.changed_js.outputs.files }}" ]; then
66
+ npx prettier --check ${{ steps.changed_js.outputs.files }}
67
+ else
68
+ echo "No JS/TS files to format check."
69
+ fi
42
70
43
71
go-lint :
44
72
runs-on : ubuntu-latest
@@ -54,11 +82,13 @@ jobs:
54
82
- name : Run golangci-lint
55
83
uses : golangci/golangci-lint-action@v8
56
84
with :
85
+ args : --enable gofmt --enable goimports
86
+ only-new-issues : true
57
87
version : latest
58
- working-directory : ./samples
59
88
60
89
build-json :
61
90
runs-on : ubuntu-latest
91
+ needs : [python-lint, js-ts-lint, go-lint]
62
92
steps :
63
93
- name : Trigger CLI Autodoc
64
94
uses : peter-evans/repository-dispatch@v1
0 commit comments