chore: restrict imports outside of the mcp.js (#456) #1118
This file contains hidden or 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
| name: Check code before submitting | |
| permissions: read-all | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| check-format: | |
| name: '[Required] Check correct format' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| cache: npm | |
| node-version-file: '.nvmrc' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run format check | |
| run: npm run check-format | |
| check-docs: | |
| name: '[Required] Check docs updated' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| cache: npm | |
| node-version-file: '.nvmrc' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate documents | |
| run: npm run docs | |
| - name: Check if autogenerated docs differ | |
| run: | | |
| diff_file=$(mktemp doc_diff_XXXXXX) | |
| git diff --color > $diff_file | |
| if [[ -s $diff_file ]]; then | |
| echo "Please update the documentation by running 'npm run generate-docs'. The following was the diff" | |
| cat $diff_file | |
| rm $diff_file | |
| exit 1 | |
| fi | |
| rm $diff_file |