Graphite tools #907
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: Token Analysis | |
| on: | |
| pull_request: | |
| permissions: {} | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build server | |
| run: make build | |
| - name: Download baseline | |
| id: download-baseline | |
| uses: dawidd6/action-download-artifact@09d0677378d50fef230b7cd4c0dea6dfe8883938 | |
| with: | |
| branch: main | |
| name: token-baseline | |
| path: baseline | |
| workflow: token-baseline.yml | |
| if_no_artifact_found: warn | |
| - name: Get secrets | |
| id: get-secrets | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| uses: grafana/shared-workflows/actions/get-vault-secrets@f1614b210386ac420af6807a997ac7f6d96e477a # get-vault-secrets/v1.3.1 | |
| with: | |
| # Secrets placed in the ci/repo/grafana/mcp-grafana/<path> path in Vault | |
| repo_secrets: | | |
| ANTHROPIC_API_KEY=anthropic:api-key | |
| - name: Analyze tokens | |
| uses: sd2k/mcp-tokens-action@014db1a0f233c4559d5b056983855b0b71c99fa2 | |
| with: | |
| command: ./dist/mcp-grafana | |
| anthropic-api-key: ${{ env.ANTHROPIC_API_KEY }} | |
| baseline: ${{ steps.download-baseline.outputs.found_artifact == 'true' && 'baseline/token-baseline.json' || '' }} | |
| threshold-percent: "5" | |
| comment: true | |
| comment-on-pass: true | |
| max-tool-changes: "10" | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |