name: Add comment
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
jobs:
add-comment:
runs-on: ubuntu-latest
steps:
- name: Fetch ephemeral GitHub token
id: fetch-token
uses: elastic/ci-gh-actions/fetch-github-token@8a7604dfdd4e7fe21f969bfe9ff96e17635ea577 # v1.0.0
with:
vault-instance: "ci-prod"
- name: Add comment
uses: actions/github-script@v7
with:
github-token: ${{ steps.fetch-token.outputs.token }}
script: |
const { owner, repo } = context.repo;
const commentBody = "**Deprecation warning:** This MCP server is deprecated and will only receive critical security updates going forward. It has been superseded by [Elastic Agent Builder](https://ela.st/agent-builder-docs)'s [MCP endpoint](https://ela.st/agent-builder-mcp), which is available in Elastic 9.2.0+ and Elasticsearch Serverless projects.";
github.rest.issues.createComment({
owner,
repo,
issue_number: context.payload.issue?.number ?? context.payload.pull_request?.number,
body: commentBody
});