Skip to content

Commit a5c9934

Browse files
committed
ci: TechEngineBot adds the 👀 ack for /verify (via passed comment_id)
1 parent 71e4f24 commit a5c9934

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/techapi-verify-comment.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,27 @@ jobs:
3232
TECHAPI_PR_NUMBER: ${{ github.event.client_payload.pr_number || inputs.pr_number }}
3333
TECHAPI_HEAD_SHA: ${{ github.event.client_payload.head_sha || inputs.head_sha }}
3434
REQUESTED_BY: ${{ github.event.client_payload.requested_by || github.actor }}
35+
TECHAPI_COMMENT_ID: ${{ github.event.client_payload.comment_id }}
3536
steps:
37+
# Acknowledge the /verify command as TechEngineBot (the bot holds the token;
38+
# the relay side must not react, or it looks like the requester self-reacting).
39+
- name: Acknowledge command (TechEngineBot 👀)
40+
if: env.TECHAPI_COMMENT_TOKEN != '' && env.TECHAPI_COMMENT_ID != ''
41+
uses: actions/github-script@v7
42+
with:
43+
github-token: ${{ secrets.TECHENGINEBOT_TOKEN || secrets.TECHAPI_TOKEN }}
44+
script: |
45+
const comment_id = Number(process.env.TECHAPI_COMMENT_ID);
46+
if (comment_id) {
47+
try {
48+
await github.rest.reactions.createForIssueComment({
49+
owner: 'GetTechAPI', repo: 'TechAPI', comment_id, content: 'eyes',
50+
});
51+
} catch (e) { core.info(`reaction skipped: ${e.message}`); }
52+
}
53+
env:
54+
TECHAPI_COMMENT_ID: ${{ github.event.client_payload.comment_id }}
55+
3656
- name: Checkout TechAPI PR head
3757
uses: actions/checkout@v4
3858
with:

0 commit comments

Comments
 (0)