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