Add TheRespectPanda Bot workflow

Includes a basic bot workflow that just answers "pong" to ping
requests, includes a help message and ignores invalid commands.

This is the minimum feature that exercises token access, non
recursive comments (answering to its own pong) and so on.
This commit is contained in:
Alexandre Gomes Gaigalas 2026-02-10 13:11:53 -03:00
commit 5d43388354

43
.github/workflows/panda.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: TheRespectPanda Bot
on:
issue_comment:
types: [created]
if: startsWith(github.event.comment.body, '@TheRespectPanda')
jobs:
listen-comment:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/github-script@v8
with:
github-token: ${{ secrets.PANDA_GITHUB_PAT }}
script: |
const body = (context.payload.comment && context.payload.comment.body).trim() || '';
const usage = 'Usage: `@TheRespectPanda ping|help`';
if (!body.startsWith('@TheRespectPanda')) {
return;
}
switch (body) {
case '@TheRespectPanda ping':
answer = 'Pong! 🐼';
break;
case '@TheRespectPanda':
case '@TheRespectPanda help':
answer = 'Hello! I am TheRespectPanda Bot. ' + usage;
break;
default:
answer = "I'm sorry, I don't understand that command. " + usage;
}
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: answer
});