From 93ba0088ac6d1a45fb054b88a28f363cb621f20e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:15:00 +0000 Subject: [PATCH 1/2] Initial plan From af16eeea736f84daf04698f03a8126a0523c7a08 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:19:41 +0000 Subject: [PATCH 2/2] Fix comment bot: look up port from Servers.xml when not provided in !check comment Agent-Logs-Url: https://github.com/acresources/serverslist/sessions/025bf5fd-c574-4813-84d5-f8eec438de40 Co-authored-by: amoeba <563+amoeba@users.noreply.github.com> --- .github/workflows/comment_bot.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/comment_bot.yml b/.github/workflows/comment_bot.yml index c980d04..8ba8e65 100644 --- a/.github/workflows/comment_bot.yml +++ b/.github/workflows/comment_bot.yml @@ -15,10 +15,32 @@ jobs: repository-projects: write id-token: write steps: + - name: Checkout repository + uses: actions/checkout@v4 - name: Extract address from comment id: extract run: | - echo "ADDRESS=$(echo ${{ github.event.comment.body }} | awk '{print $2}')" >> $GITHUB_OUTPUT + 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 +tree = ET.parse('Servers.xml') +root = tree.getroot() +for item in root.findall('ServerItem'): + host = item.find('server_host') + port = item.find('server_port') + if host is not None and port is not None and host.text.strip() == sys.argv[1]: + print(port.text.strip()) + break +" "$INPUT") + if [ -n "$PORT" ]; then + echo "ADDRESS=$INPUT:$PORT" >> $GITHUB_OUTPUT + else + echo "ADDRESS=$INPUT" >> $GITHUB_OUTPUT + fi + fi - uses: actions/github-script@v6 with: script: |