Skip to content

Commit f5264db

Browse files
authored
Fix add-comment workflow again (#233)
1 parent efb91f1 commit f5264db

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/auto-comment.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
name: Add comment
22
on:
33
issues:
4-
types:
5-
- opened
4+
types: [opened]
65
pull_request_target:
7-
types:
8-
- opened
6+
types: [opened]
7+
98
jobs:
109
add-comment:
1110
runs-on: ubuntu-latest
12-
permissions:
13-
issues: write
1411
steps:
1512
- name: Add comment
16-
run: gh issue comment "$NUMBER" --body "$BODY"
17-
env:
18-
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
19-
GH_REPO: ${{ github.repository }}
20-
NUMBER: ${{ github.event.number }}
21-
BODY: >
22-
# :warning: Deprecation warning
13+
uses: actions/github-script@v7
14+
with:
15+
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
16+
script: |
17+
const { owner, repo } = context.repo;
18+
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.";
2319
24-
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.
20+
github.rest.issues.createComment({
21+
owner,
22+
repo,
23+
issue_number: context.payload.issue.number,
24+
body: commentBody
25+
});

0 commit comments

Comments
 (0)