Skip to content

Fix comment bot panic when !check is used with hostname-only address#198

Closed
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-comment-check-bot
Closed

Fix comment bot panic when !check is used with hostname-only address#198
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-comment-check-bot

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 1, 2026

ac-server-monitor requires host:port format for -check, but the comment bot was passing only the hostname (e.g., play.coldeve.ac), causing a panic and exit code 2.

Changes

  • Checkout repository first — adds actions/checkout@v4 before the extract step so Servers.xml is available
  • Auto-resolve port from Servers.xml — when the provided address has no :, Python parses Servers.xml to look up the matching server_port; falls back to the bare hostname if not found
  • Pass-through for host:port input — if the comment already includes a port, it's used as-is
INPUT=$(echo "${{ github.event.comment.body }}" | awk '{print $2}')
if echo "$INPUT" | grep -q ':'; then
  echo "ADDRESS=$INPUT" >> $GITHUB_OUTPUT
else
  PORT=$(python3 -c "
import xml.etree.ElementTree as ET, sys
...
if host.text.strip() == sys.argv[1]:
    print(port.text.strip())
" "$INPUT")
  echo "ADDRESS=$INPUT:$PORT" >> $GITHUB_OUTPUT
fi

Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix parsing issue in comment check bot Fix comment bot panic when !check is used with hostname-only address Apr 1, 2026
Copilot AI requested a review from amoeba April 1, 2026 21:20
@amoeba
Copy link
Copy Markdown
Collaborator

amoeba commented Apr 1, 2026

(Just testing copilot on this since I haven't done it much)

@amoeba amoeba closed this Apr 1, 2026
@amoeba
Copy link
Copy Markdown
Collaborator

amoeba commented Apr 2, 2026

!check the-tower.ddns.net

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

⏳ Checking if I can connect and log in to the-tower.ddns.net. Give me a minute...

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

✅ the-tower.ddns.net was up and I was able to log in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix comment !check bot

2 participants