build(deps-dev): bump @biomejs/biome from 2.4.0 to 2.4.4 in /mcp #252
Workflow file for this run
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: Continuous Releases | |
| on: | |
| pull_request: | |
| types: | |
| - labeled | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| detect-changes: | |
| if: ${{ github.event.label.name == 'preview' }} | |
| runs-on: ubuntu-latest | |
| outputs: | |
| typescript: ${{ steps.changes.outputs.typescript }} | |
| mcp: ${{ steps.changes.outputs.mcp }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect file changes | |
| id: changes | |
| run: | | |
| git fetch origin "${{ github.base_ref }}" | |
| if git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -q "^typescript/"; then | |
| echo "typescript=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "typescript=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| if git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -q "^mcp/"; then | |
| echo "mcp=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "mcp=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| publish-typescript: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.typescript == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version-file: ./typescript/package.json | |
| cache: npm | |
| cache-dependency-path: ./typescript/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ./typescript | |
| - name: Build package | |
| run: npm run build | |
| working-directory: ./typescript | |
| - name: Publish preview package | |
| run: npx pkg-pr-new publish './typescript' --json output.json --comment=off | |
| - name: Post or update comment | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| const output = JSON.parse(fs.readFileSync('output.json', 'utf8')); | |
| console.log(output); | |
| const packages = output.packages | |
| .map((p) => `- ${p.name}: ${p.url}`) | |
| .join('\n'); | |
| const sha = context.payload.pull_request.head.sha | |
| const commitUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${sha}`; | |
| const body = `## 🚀 TypeScript SDK Preview Published | |
| ### Published Packages: | |
| ${packages} | |
| [View Commit](${commitUrl})`; | |
| const botCommentIdentifier = '## 🚀 TypeScript SDK Preview Published'; | |
| async function findBotComment(issueNumber) { | |
| if (!issueNumber) return null; | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| }); | |
| return comments.data.find((comment) => | |
| comment.body.includes(botCommentIdentifier) | |
| ); | |
| } | |
| async function createOrUpdateComment(issueNumber) { | |
| if (!issueNumber) { | |
| console.log('No issue number provided. Cannot post or update comment.'); | |
| return; | |
| } | |
| const existingComment = await findBotComment(issueNumber); | |
| if (existingComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existingComment.id, | |
| body: body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| issue_number: issueNumber, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body, | |
| }); | |
| } | |
| } | |
| if (context.issue.number) { | |
| await createOrUpdateComment(context.issue.number); | |
| } | |
| publish-mcp: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.mcp == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version-file: ./mcp/package.json | |
| cache: npm | |
| cache-dependency-path: ./mcp/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ./mcp | |
| - name: Build package | |
| run: npm run build | |
| working-directory: ./mcp | |
| - name: Publish preview package | |
| run: npx pkg-pr-new publish './mcp' --json output.json --comment=off | |
| - name: Post or update comment | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| const output = JSON.parse(fs.readFileSync('output.json', 'utf8')); | |
| console.log(output); | |
| const packages = output.packages | |
| .map((p) => `- ${p.name}: ${p.url}`) | |
| .join('\n'); | |
| const sha = context.payload.pull_request.head.sha | |
| const commitUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${sha}`; | |
| const body = `## 🚀 MCP Preview Published | |
| ### Published Packages: | |
| ${packages} | |
| [View Commit](${commitUrl})`; | |
| const botCommentIdentifier = '## 🚀 MCP Preview Published'; | |
| async function findBotComment(issueNumber) { | |
| if (!issueNumber) return null; | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| }); | |
| return comments.data.find((comment) => | |
| comment.body.includes(botCommentIdentifier) | |
| ); | |
| } | |
| async function createOrUpdateComment(issueNumber) { | |
| if (!issueNumber) { | |
| console.log('No issue number provided. Cannot post or update comment.'); | |
| return; | |
| } | |
| const existingComment = await findBotComment(issueNumber); | |
| if (existingComment) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existingComment.id, | |
| body: body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| issue_number: issueNumber, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body, | |
| }); | |
| } | |
| } | |
| if (context.issue.number) { | |
| await createOrUpdateComment(context.issue.number); | |
| } | |
| cleanup: | |
| needs: [detect-changes, publish-typescript, publish-mcp] | |
| if: always() && github.event.label.name == 'preview' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete label | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| gh pr edit "$PR_NUMBER" --remove-label "preview" |